EXTFNAPIV4_DESCRIBE_COL_SCALE (Set)

The EXTFNAPIV4_DESCRIBE_COL_SCALE attribute indicates the scale of the column. Used in a describe_column_set scenario.

Data Type

a_sql_uint32

Description

The scale of a column. For arithmetic data types, parameter scale is the number of digits to the right of the decimal point in a number. This property is valid only for table arguments.

Usage

If the UDF sets this property, the server compares the value with the scale of the column supplied in the CREATE PROCEDURE statement. This allows the UDF to ensure the CREATE PROCEDURE statement has the same column width as expected by the UDF. This property is valid only for arithmetic data types.

Returns

On success, returns the sizeof(a_sql_uint32), or:
  • EXTFNAPIV4_DESCRIBE_NOT_AVAILABLE – set error returned if the scale is not available for the data type of the specified column.

On failure, returns one of the generic describe_column errors, or:
  • EXTFNAPIV4_DESCRIBE_BUFFER_SIZE_MISMATCH – set error returned if the describe buffer is not the size of a_sql_uint32.
  • EXTFNAPIV4_DESCRIBE_INVALID_STATE – set error returned if the query processing state is not Annotation.
  • EXTFNAPIV4_DESCRIBE_INVALID_ATTRIBUTE_VALUE – set error returned if the input scale and scale stored in the catalog do not match.

Query Processing States

Valid in:

Example

	short desc_rc = 0;
	a_sql_uint32 scale = 0;

			// Verify that the procedure has a scale of zero for the second result table column.
		if( ctx->current_state == EXTFNAPIV4_STATE_ANNOTATION ) {
		desc_rc = ctx->describe_column_set( ctx, 0, 2, EXTFNAPIV4_DESCRIBE_COL_SCALE, 
			&scale, 
			sizeof(a_sql_data_type) );
		if( desc_rc < 0 ) {
			// handle the error.
		}
	}
Related concepts
Query Processing States
Related reference
EXTFNAPIV4_DESCRIBE_COL_SCALE (Get)
Generic describe_column Errors