Use this statement to retrieve information about a variable within a descriptor area, or retrieves its value.
GET DESCRIPTOR descriptor-name { hostvar = COUNT | VALUE { integer | hostvar } assignment, ... }
assignment : hostvar = TYPE | LENGTH | PRECISION | SCALE | DATA | INDICATOR | NAME | NULLABLE | RETURNED_LENGTH
The GET DESCRIPTOR statement is used to retrieve information about a variable within a descriptor area, or to retrieve its value.
The value { integer | hostvar } specifies the variable in the descriptor area about which the information is retrieved. Type checking is performed when doing GET ... DATA to ensure that the host variable and the descriptor variable have the same data type. LONG VARCHAR and LONG BINARY are not supported by GET DESCRIPTOR ... DATA.
If an error occurs, it is returned in the SQLCA.
None.
None.
SQL/2003 Core feature.
The following example returns the type of the column with position col_num in sqlda.
int get_type( SQLDA *sqlda, int col_num ) { EXEC SQL BEGIN DECLARE SECTION; int ret_type; int col = col_num; EXEC SQL END DECLARE SECTION; EXEC SQL GET DESCRIPTOR sqlda VALUE :col :ret_type = TYPE; return( ret_type ); } |
For a longer example, see ALLOCATE DESCRIPTOR statement [ESQL].
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |