Subject | Re: [ib-support] working with blobs in delphi |
---|---|
Author | Helen Borrie |
Post date | 2002-01-17T12:55:38Z |
At 03:31 PM 17-01-02 +0800, you wrote:
As a start: some stuff about blobs in Firebird/InterBase..
IB and Firebird don't store blobs on the same page as the rest of table data. They store a Blob ID and the blob itself gets stored on (guess what?) BLOB pages, one or many, depending on database page size and the size of the blob.
Text blobs are BLOB SUB-TYPE 1. Unstructured binary blobs are BLOB SUB_TYPE 0. You can create your own sub_types numbered < 0 to use in conjunction with blob filters (library routines that you write in C, C++ or Delphi to massage blob contents). (Don't ask....{{{shudder}}})
In InterBase, the input to a blob insert or update has to be a blob. You can do stuff in Delphi to "make it so" (see the Delphi help for how to do it with the VCL components). IB Objects has a whole lot of stuff for passing blobs around, too much to describe here, where Delphi is off-topic.
In Firebird, you can input a string to a blob column, which solves a lot of problems. (It will be even cooler when you can stream blobs back and forth from external files...but not today).
You ought to be able to use a blob as an input to a stored procedure. The InterBase docs say you can't. This is Borland's workaround for a bug in the re-storage of blob data from stored procedures. I believe the bug was fixed in Firebird quite long time ago - Claudio, can you confirm?
FreeUDFLib has a number of UDFs for manipulating text blobs in SQL and SPs. Make sure you get the fixed version from Claudio's website (http://www.cvalde.com).
http://www.ibphoenix.com/ibp_blobs.html
regards,
Helen
All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________
>Does anyone have a link to a good tuturial on working with blobs in Delphi and IB?No; and how you handle blobs in Delphi will depend on the data access components you use.
As a start: some stuff about blobs in Firebird/InterBase..
IB and Firebird don't store blobs on the same page as the rest of table data. They store a Blob ID and the blob itself gets stored on (guess what?) BLOB pages, one or many, depending on database page size and the size of the blob.
Text blobs are BLOB SUB-TYPE 1. Unstructured binary blobs are BLOB SUB_TYPE 0. You can create your own sub_types numbered < 0 to use in conjunction with blob filters (library routines that you write in C, C++ or Delphi to massage blob contents). (Don't ask....{{{shudder}}})
In InterBase, the input to a blob insert or update has to be a blob. You can do stuff in Delphi to "make it so" (see the Delphi help for how to do it with the VCL components). IB Objects has a whole lot of stuff for passing blobs around, too much to describe here, where Delphi is off-topic.
In Firebird, you can input a string to a blob column, which solves a lot of problems. (It will be even cooler when you can stream blobs back and forth from external files...but not today).
You ought to be able to use a blob as an input to a stored procedure. The InterBase docs say you can't. This is Borland's workaround for a bug in the re-storage of blob data from stored procedures. I believe the bug was fixed in Firebird quite long time ago - Claudio, can you confirm?
FreeUDFLib has a number of UDFs for manipulating text blobs in SQL and SPs. Make sure you get the fixed version from Claudio's website (http://www.cvalde.com).
>I have scoured the manuals and my usual interbase resources and have only turned up some very basic information that hasn't been much help.See Paul Beach's article at IBPhoenix:
http://www.ibphoenix.com/ibp_blobs.html
regards,
Helen
All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________