It is possible to create functions which operate on large object data types. The following library functions exists to provide the ability use LOB's as function input or output:
• FNC_GetLobLength - acquire Lob length
• FNC_LobAppend - add to Lob in memory
• FNC_LobClose - close a context to a Lob
• FNC_LobOpen - open a context to a Lob
• FNC_LobRead - read some or all
• FNC_LobRef2Loc - convert a Lob Reference to a Locator
• FNC_LobLoc2Ref - convert a Locator to a Lob Reference
Example :
The CREATE FUNCTION syntax permits BLOB's or CLOB's to be the data type of an argument or a return value
CREATE FUNCTION JPEG_CROP
(
Image BLOB AS LOCATOR
Width INTEGER,
Height INTEGER,
X_Offset INTEGER,
Y_Offset INTEGER
)
RETURNS BLOB AS LOCATOR
LANGUAGE C
NO SQL
EXTERNAL;