Subject Passing a BLOB parameter into an exexcute procedure statement
Author Richard Mace
Hi,

I have a procedure called add_message which has an input parameter
that is a BLOB field.

The procedure looks like this:

CREATE PROCEDURE ADD_MESSAGE
(
ipId INTEGER,
ipBody BLOB SUB_TYPE 1 SEGMENT SIZE 800,
)
AS
BEGIN
INSERT INTO
MESSAGES
(
Id,
Body,
)
VALUES
(
:ipId,
:ipBody
);

EXECUTE PROCEDURE ADD_MESSAGE_SENT(0,:ipBody);
END
^

As you can see, when the add_message procedure is executed, I want to
execute another one called add_message_sent, and pass in the ipBody,
but if I do the above, I get an error:

"invalid blob id"

The add_message_sent procedure looks like this:

CREATE PROCEDURE ADD_MESSAGE_SENT
(
ipId INTEGER,
ipBody BLOB SUB_TYPE 1 SEGMENT SIZE 800
)
AS
BEGIN
INSERT INTO
MESSAGES_SENT
(
Id,
Body
)
VALUES
(
:ipId,
:ipBody
);
END
^

If I comment out the "execute add_sent_message" statement, it works fine.
Any ideas?

Thanks in advance

Richard