|
|
GET DESCRIPTOR
Gets values from an SQL descriptor area.
Usage
Description
Values are retrieved from the specified SQL descriptor area. The GET DESCRIPTOR statement can be used in two forms:
- To determine the number of active item descriptor areas for the specified SQL descriptor, the form ...host-variable = COUNT is used.
- The VALUE form is used to retrieve SQL descriptor field values from the item descriptor area specified by item-number.
When using GET DESCRIPTOR with DESCRIBE OUTPUT, if COUNT > 0, the output is a result-set and a cursor should be used to retrieve data.
The descriptor-name is identified by a host variable or a literal.
Item Descriptor Area
An item descriptor area contains the following fields:
TYPE Fields in the Item Descriptor Area
The TYPE field in the item descriptor area can contain one of the following values:
Code
SQL data type
1 CHARACTER 2 NUMERIC 3 DECIMAL 4 INTEGER 5 SMALLINT 6 FLOAT 7 REAL 8 DOUBLE PRECISION 9 DATETIME 10 INTERVAL 12 VARCHAR 30 BLOB 40 CLOB -2 BINARY1 -3 BINARY VARYING -8 NCHAR -9 NCHAR VARYING -11 INTEGER(p)2
DATETIME Data Types in the Item Descriptor Area
For DATETIME data types, the DATETIME_INTERVAL_CODE field in the item descriptor area can contain one of the following values:
Code
DATETIME subtype
1 DATE 2 TIME 3 TIMESTAMPINTERVAL Data Types in the Item Descriptor Area
For INTERVAL data types, the DATETIME_INTERVAL_CODE field in the item descriptor area can contain one of the following values:
Code
INTERVAL subtype
1 YEAR 2 MONTH 3 DAY 4 HOUR 5 MINUTE 6 SECOND 7 YEAR TO MONTH 8 DAY TO HOUR 9 DAY TO MINUTE 10 DAY TO SECOND 11 HOUR TO MINUTE 12 HOUR TO SECOND 13 MINUTE TO SECONDParameters in the Item Descriptor Area
For routine parameters, the PARAMETER_MODE field in the item descriptor area can contain one of the following values:
Code
PARAMETER_MODE
1 PARAMETER_MODE_IN 2 PARAMETER_MODE_INOUT 4 PARAMETER_MODE_OUTRestrictions
Notes
The value of the DATA field is undefined if the INDICATOR field indicates the NULL value.
The data type of the host variables must be compatible with the data type of the associated field name.
Example
EXEC SQL GET DESCRIPTOR 'SQLA' VALUE 1 :hostvar1 = DATA;For more information, see the Mimer SQL Programmer's Manual, chapter 11, SQL Descriptor Area.
Standard Compliance
Standard
Compliance
Comments
X/Open-95
SQL-92 YES Fully compliant.
|
Upright Database Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 dbtechnology@upright.se |
|
|