ASA SQL Reference
SQL Statements
Use this statement to describe the variables in a SQL descriptor area and to place data into the descriptor area.
SET DESCRIPTOR descriptor-name
{ COUNT = { integer | hostvar }
| VALUE { integer | hostvar } assignment [, ...] }
assignment :
{ TYPE | SCALE | PRECISION | LENGTH | INDICATOR }
= { integer | hostvar }
| DATA = hostvar
The SET DESCRIPTOR statement is used to describe the variables in a descriptor area, and to place data into the descriptor area.
The SET ... COUNT statement sets the number of described variables within the descriptor area. The value for count must not exceed the number of variables specified when the descriptor area was allocated.
The value { integer | hostvar } specifies the variable in the descriptor area upon which the assignment(s) will be performed.
Type checking is performed when doing SET ... DATA, to ensure that the variable in the descriptor area has the same type as the host variable. LONGVARCHAR and LONGBINARY are not supported by SET DESCRIPTOR ... DATA.
If an error occurs, the code is returned in the SQLCA.
None.
None.
ALLOCATE DESCRIPTOR statement [ESQL]
DEALLOCATE DESCRIPTOR statement [ESQL]
The SQL descriptor area (SQLDA)
SQL/92 Intermediate-level feature.
SQL/99 SQL/foundation feature outside of core SQL.
Sybase Supported by Open Client/Open Server.
The following example sets the type of the column with position col_num in sqlda.
void set_type( SQLDA *sqlda, int col_num, int new_type ) { EXEC SQL BEGIN DECLARE SECTION; int new_type1 = new_type; int col = col_num; EXEC SQL END DECLARE SECTION; EXEC SQL SET DESCRIPTOR sqlda VALUE :col TYPE = :new_type1; }
For a longer example, see ALLOCATE DESCRIPTOR statement [ESQL].