Declaring a Blob UDF

From InterBase

Go Up to Writing a Blob UDF


To specify that a UDF should return a Blob, use the RETURNS PARAMETER <n> statement to specify which input Blob is to be returned. For example, if the Blob to be returned is the third input parameter, specify RETURNS PARAMETER 3. In the following example, the Blob_PLUS_Blob UDF concatenates two Blobs and returns the concatenation in a third Blob. The following statement declares this UDF to a database, specifying that the third input parameter is the one that should be returned:

DECLARE EXTERNAL FUNCTION Blob_PLUS_Blob
Blob,
Blob,
Blob
RETURNS PARAMETER 3
ENTRY_POINT 'blob_concatenate' MODULE_NAME 'ib_udf';
COMMIT;

The blob_concatenate() function shown as the entry point above is defined in the following Blob UDF example. The blob_concatenate() function concatenates two blobs into a third blob.

Advance To: