Subject Re: [IBO] Selectable stored procedures and IBO
Author Helen Borrie
At 12:02 AM 11/09/2007, you wrote:
>--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
> > Have you tested your EXECUTE PROCEDURE statement in IB_SQL?
> >
> > Helen
> >
>
>Normally i always check and debug the SQL code in IB_SQL. And i done it
>this time too. But no error was reported it just compiled and runned
>fine!
>After another session of testing the procedure, i found out that the
>problem was a blob field that was being passed as a parameter in the
>SSP, something like this "EXECUTE PROCEDURE SSP(:ESP_BLOB_FIELD)". On
>Delphi, whenever i try to use this field as a parameter, the exception
>reported on my last post is thrown.
>
>Im a bit more happy now, cause i know that the SSP's work, but how do i
>update a blob field. Lets say a blob that holds an image, or any other
>binary format? Can it be done this way?

If your XxxxSQL statement really is

EXECUTE PROCEDURE SSP(:ESP_BLOB_FIELD)

then this is the cause of the "internal error". You cannot EXECUTE a
selectable stored procedure, you can only SELECT from it.

You must write one or more SEPARATE procedures for the XxxxSQL
operations, that include the Key values for the targeted records in
their inputs. A blob can never be a key.

It *is* possible to pass a blob as a parameter to an executable SP
but the assignment for blobs is quite different to that for regular
data fields. The data access object has to *know* the connection
between the field in the SSP and the parameter in the ESP.

Is the NAME of the parameter actually the same as the name of the
blob field in the SSP? If not, then change it so that it is the
same, e.g., if the blob field in the SSP is SSP_BLOB_FIELD then the
XxxxSQL statement should be

EXECUTE PROCEDURE ESP(:aKeyField, ......, :SSP_BLOB_FIELD)

At this point I feel the need to remark that you're not providing
enough information about these SPs.

Helen