EXTFNAPIV4_DESCRIBE_PARM_IS_CONSTANT Attribute (Get)

The EXTFNAPIV4_DESCRIBE_PARM_DISTINCT_VALUES attribute returns whether or not the parameter is constant. Used in a describe_parameter_get scenario.

Data Type

a_sql_byte

Description

True, if the parameter is a constant for the statement. Valid only for scalar parameters.

Usage

Returns 0 if the value of the specified parameter is not a constant; returns 1 if the value of the specified parameter is a constant.

Returns

On success, returns the sizeof(a_sql_byte).

On failure, returns one of the generic describe_parameter errors or:
  • EXTFNAPIV4_DESCRIBE_BUFFER_SIZE_MISMATCH – get error returned if the describe_buffer is not the size of a_sql_byte.
  • EXTFNAPIV4_DESCRIBE_INVALID_STATE – get error returned if the state is not greater than Initial.
  • EXTFNAPIV4_DESCRIBE_INVALID_PARAMETER – get error returned if the parameter is a table parameter.

Query Processing States

Valid in:
  • Annotation state
  • Query Optimization state
  • Plan Building state
  • Execution state

Example

Sample _describe_extfn API function code fragment:

if( ctx->current_state >= EXTFNAPIV4_STATE_ANNOTATION ) {
	desc_rc = ctx->describe_parameter_get( ctx,
		1,
		EXTFNAPIV4_DESCRIBE_PARM_IS_CONSTANT,
		&desc_byte, sizeof( a_sql_byte ) );
}