Subject | Re: [firebird-support] Passing a BLOB parameter into an exexcute procedure statement |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2006-01-16T05:41:44Z |
On 13 Jan 2006 at 16:24, Richard Mace wrote:
your application, it gets temporary blob id. When you use this blob
id in INSERT statement, this blob is "materialized" and temporary id
become invalid.
This process has one annoying consequence: you can't use new blob
id twice. Your case shows that it includes Stored Procedures.
As the solution you have to retrieve the real (materialized) blob
id after insert:
....
SELECT Body FROM MESSAGES WHERE Id=:ipId INTO :ipBody;
EXECUTE PROCEDURE ADD_MESSAGE_SENT(0,:ipBody);
....
--
SY, Dimitry Sibiryakov.
>I have a procedure called add_message which has an input parameterYour problem is "blob materialization". When you create new BLOB in
>that is a BLOB field.
>
>If I comment out the "execute add_sent_message" statement, it works
>fine. Any ideas?
your application, it gets temporary blob id. When you use this blob
id in INSERT statement, this blob is "materialized" and temporary id
become invalid.
This process has one annoying consequence: you can't use new blob
id twice. Your case shows that it includes Stored Procedures.
As the solution you have to retrieve the real (materialized) blob
id after insert:
....
SELECT Body FROM MESSAGES WHERE Id=:ipId INTO :ipBody;
EXECUTE PROCEDURE ADD_MESSAGE_SENT(0,:ipBody);
....
--
SY, Dimitry Sibiryakov.