The EXTFNAPIV4_DESCRIBE_PARM_CONSTANT_VALUE attribute indicates the value of the parameter. Used in a describe_parameter_get scenario.
Description
The value of the parameter if it is known at describe time. Valid only for scalar parameters.
Usage
Returns the value of the parameters.
Returns
On success, returns the
sizeof(an_extfn_value) if the value is available, or:
- EXTFNAPIV4_DESCRIBE_NOT_AVILABLE
– Value returned if the value is not constant.
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 an_extfn_value.
- 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 ) {
a_sql_int32 desc_rc;
desc_rc = ctx->describe_parameter_get( ctx,
1,
EXTFNAPIV4_DESCRIBE_PARM_CONSTANT_VALUE,
&arg,
sizeof( an_extfn_value ) );
}