ASA SQL Reference
SQL Statements
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 will be retrieved. Type checking is performed when doing GET ... DATA to ensure that the host variable and the descriptor variable have the same data type. LONGVARCHAR and LONGBINARY are not supported by GET DESCRIPTOR ... DATA.
If an error occurs, it is returned in the SQLCA.
None.
None.
ALLOCATE DESCRIPTOR statement [ESQL]
DEALLOCATE DESCRIPTOR statement [ESQL]
SET DESCRIPTOR statement [ESQL]
The SQL descriptor area (SQLDA)
SQL/92 Entry-level feature.
SQL/99 Core feature.
Sybase Supported by Open Client/Open Server.
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].