EXTFNAPIV4_DESCRIBE_COL_TYPE (Set)

The EXTFNAPIV4_DESCRIBE_COL_TYPE attribute indicates the data type of the column. Used in a describe_column_set scenario.

Data Type

a_sql_data_type

Description

The data type of the column. This property is valid only for table arguments.

Usage

For argument zero, if the UDF sets this property, then the server compares the value with the data type of the column supplied in the CREATE PROCEDURE statement. This allows the UDF to ensure the CREATE PROCEDURE statement has the same data type as expected by the UDF.

Returns

On success, returns the a_sql_data_type.

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_data_type.

  • EXTFNAPIV4_DESCRIBE_INVALID_STATE – Set error returned if the state is not Annotation.

  • EXTFNAPIV4_DESCRIBE_ INVALID_ATTRIBUTE_VALUE – Set error returned if the input data type and the data type stored in the catalog do not match,.

Query processing states

Example

short desc_rc = 0;
a_sql_data_type type = DT_INT;

	// Verify that the procedure was created with the second column of the result table as an int	
	if( ctx->current_state == EXTFNAPIV4_STATE_ANNOTATION ) {
		desc_rc = ctx->describe_column_set( ctx, 0, 2, EXTFNAPIV4_DESCRIBE_COL_TYPE, 
		&type, 
				sizeof(a_sql_data_type) );
		if( desc_rc < 0 ) {
			// handle the error.
		}
	}
Related concepts
Query Processing States
Related reference
Generic describe_column Errors
EXTFNAPIV4_DESCRIBE_COL_TYPE (Get)