Specifying Parameters

From InterBase
Jump to: navigation, search

Go Up to Writing a UDF


A UDF can accept up to ten parameters corresponding to any InterBase data type. Array elements cannot be passed as parameters. If a UDF returns a Blob, the number of input parameters is restricted to nine. All parameters are passed to the UDF by reference.

Programming language data types specified as parameters must be capable of handling corresponding InterBase data types. For example, the C function declaration for FN_ABS() accepts one parameter of type double. The expectation is that when FN_ABS() is called, it will be passed a data type of DOUBLE PRECISION by InterBase.

You can use a descriptor parameter to ensure that the InterBase server passes all of the information it has about a particular data type to the function. A descriptor parameter assists the server in probing the data type to see if any of its values are SQL NULL. For more information about the DESCRIPTOR parameter, see Defining a Sample UDF with a Descriptor Parameter.

UDFs that accept Blob parameters require special data structure for processing. A Blob is passed by reference to a Blob UDF structure. For more information about the Blob UDF structure, see Writing a Blob UDF.