Subject Re: [ib-support] Re: working with blobs in delphi
Author Helen Borrie
At 06:42 PM 29-01-02 +0100, you wrote:

>You mention the Blob_type... how can it be specified?

Sorry, sloppy typing. BLOB SUB_TYPE 1 is a text blob. The default (BLOB SUB_TYPE 0) can be any kind of blob. Above 1 I think are some sub-types that the engine uses internally. Below zero are user-defined types (blob filters that you create as a special kind of UDF).

>I'm using this
>statement to declare the UDF:
>
> DECLARE EXTERNAL FUNCTION foo
> CSTRING(128), BLOB
> RETURNS PARAMETER 2
> ENTRY_POINT 'foo_entry_point' MODULE_NAME 'foo_module_name'
>
>trying to mimic the `string2blob' UDF contained in the fbudf library.
>Is there a better way?

Here's the declaration for string2blob:

declare external function string2blob
varchar(300) by descriptor,
blob returns parameter 2
entry_point 'string2blob' module_name 'fbudf';

FBUDF is different to previous UDF libraries in that it handles the input arguments by descriptor. Claudio's source for FBUDF is available from the FB source tree. I haven't done any UDFs using descriptors myself.

Why not post a message in firebird-devel for Claudio?

You will find a number of threads on the subject in the firebird-devel archives at news://news.atkin.com. Claudio wrote prolifically about it.

There are links to Greg Deatz' original papers on writing UDFs (including stuff specific to Delphi) in the Documentation Index at the firebirdsql.org site. That should be generally applicable to Kylix as well.

cheers,
Helen

All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________