EXTFNAPIV4_DESCRIBE_COL_NAME (Set)

The EXTFNAPIV4_DESCRIBE_COL_NAME attribute indicates a column name. Used in a describe_column_set scenario.

Data Type

char[]

Description

The column name. This property is valid only for table arguments.

Usage

For argument 0, if the UDF sets this property, the server compares the value with the name of the column supplied in the CREATE PROCEDURE statement. The comparison ensures that the CREATE PROCEDURE statement has the same column name as expected by the UDF.

Returns

On success, returns the length of the column name.

On failure, returns one of the generic describe_column errors, or:
  • EXTFNAPIV4_DESCRIBE_INVALID_STATE – set error returned if the state is not Annotation.

  • EXTFNAPIV4_DESCRIBE_NON_TABLE_PARAMETER – set error returned if the parameter is not a Table parameter.

  • EXTFNAPIV4_DESCRIBE_ INVALID_ATTRIBUTE_VALUE – set error returned if the length of input column name exceeds 128 characters or if the input column name and column name stored in the catalog do not match.

Query Processing States

Example

short desc_rc = 0;
     char name[7] = ‘column1’;
     // 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_NAME, 
			                                                   name, 
			                                                   sizeof(name) );
          if( desc_rc < 0 ) {
          // handle the error.
          }
     }