The EXTFNAPIV4_DESCRIBE_PARM_WIDTH attribute indicates the width of a parameter. Used in a describe_parameter_set scenario.
Description
The width of a parameter to a UDF. EXTFNAPIV4_DESCRIBE_PARM_WIDTH applies only to scalar parameters. Parameter width is the amount of storage, in bytes, required to store a parameter of the associated data type.
- Fixed length data types – the bytes required to store the data.
- Variable length data types – the maximum length.
- LOB data types – the amount of storage required to store a handle to the data.
- TIME data types – the amount of storage required to store the encoded time.
Usage
This is a read-only property. The width is derived from the associated column data type. Once the data type is set, you cannot change the width.
Returns
On success, returns the sizeof(a_sql_uint32).
On failure, returns one of the generic
describe_parameter errors or:
- EXTFNAPIV4_DESCRIBE_INVALID_STATE – set error returned if the query processing state is not equal to Annotation.
- EXTFNAPIV4_DESCRIBE_BUFFER_SIZE_MISMATCH – set error returned if the describe_buffer is not the size of a_sql_uint32.
- EXTFNAPIV4_DESCRIBE_INVALID_PARAMETER – set error returned if the specified parameter is a table parameter. This includes parameter 0, or parameter n, where n is an input table.
- EXTFNAPI4_DESCRIBE_INVALID_ATTRIBUTE_VALUE – set error returned if the UDF tries to reset the parameter width.