Subject Re: [firebird-support] Passing a BLOB parameter into an exexcute procedure statement
Author Richard Mace
> >I have a procedure called add_message which has an input parameter
> >that is a BLOB field.
> >
> >If I comment out the "execute add_sent_message" statement, it works
> >fine. Any ideas?
>
> Your problem is "blob materialization". When you create new BLOB in
> 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);

Thanks for your help.
I did try the above, but I seem to be getting the exact same error message.
Any further pointers?

Richard