Subject Re: [ib-support] Inserting a Blob from within a stored procedure
Author Claudio Valderrama C.
""greatdaydan"" <greatdaydan@...> wrote in message
> What do I need to do, in the sp, to add data to the blob field?
> Use the API calls? How? Do I need to create the string first, then
> add it to the blob, then use the blob_id as the value for the Notes
> field? Is this done with a cursor?

Inside a stored procedure:
update tbl set blobfld = appendblob(blobfld, newstring)
where keyfield = keyvalue;

NewString and and KeyValue are parameters to your stored procedure.
AppendBlob is a UDF that you should write.

> Can you give me or point me to an example (preferbly in Delphi)?

Now that I read "Delphi", I need to clarify. Do you want a stored proc in
the engine for doing that or do you want a client-side Delphi procedure? If
from Delphi, you should retrieve the blob contents, append your data and
post again the blob. If it's long, it will be more efficiently done in the
engine provided that you create the needed UDF.
How you manage the blob from Delphi depends on which package you are using.
IBO and FibPlus should provide facilities for blob handling. If your program
calls the API directly, you can call the API to deal with blobs directly.

Claudio Valderrama C. - -
Independent developer
Owner of the Interbase® WebRing