|
|
GET DESCRIPTOR
Gets values from an SQL descriptor area.
Usage
Description
Values are retrieved from the specified SQL descriptor area. The
GET DESCRIPTORstatement can be used in two forms:
- To determine the number of active item descriptor areas for the specified SQL descriptor, the form
...host-variable = COUNTis used.TOP_LEVEL_COUNTis used to determine the top level columns (or parameters).- The values of
COUNTandTOP_LEVEL_COUNTare usually the same. They do only differ when structured user-defined types are involved andWITH NESTINGis specified when performing theDESCRIBEstatement.- The
VALUEform is used to retrieve SQL descriptor field values from the item descriptor area specified by item-number.When using
GET DESCRIPTORwithDESCRIBE OUTPUT, ifCOUNT> 0, the output is a result set and a cursor should be used to retrieve data.The
descriptor-nameis 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
1CHARACTER2NUMERIC3DECIMAL4INTEGER5SMALLINT6FLOAT7REAL8DOUBLE PRECISION9DATETIME10INTERVAL12VARCHAR16BOOLEAN17 User-defined type125BIGINT30BLOB40CLOB60BINARY261BINARY VARYING-8NCHAR-9NCHAR VARYING-11INTEGER(p)3-40NCLOB
1The user-defined type is specified using the item descriptor areas
USER_DEFINED_TYPE_CATALOG,USER_DEFINED_TYPE_SCHEMA, andUSER_DEFINED_TYPE_NAME.2Null padding is applied to the fixed size BINARY data type.
3INTEGER(p) is a Mimer SQL specific data type used for integer data with a specified precision.
DATETIME Data Types in the Item Descriptor Area
For
DATETIMEdata types, theDATETIME_INTERVAL_CODEfield in the item descriptor area can contain one of the following values:INTERVAL Data Types in the Item Descriptor Area
For
INTERVALdata types, theDATETIME_INTERVAL_CODEfield in the item descriptor area can contain one of the following values:
Code
INTERVAL subtype
1YEAR2MONTH3DAY4HOUR5MINUTE6SECOND7YEAR TO MONTH8DAY TO HOUR9DAY TO MINUTE10DAY TO SECOND11HOUR TO MINUTE12HOUR TO SECOND13MINUTE TO SECONDParameters in the Item Descriptor Area
For routine parameters, the
PARAMETER_MODEfield in the item descriptor area can contain one of the following values:Notes
The value of the
DATAfield is undefined if theINDICATORfield indicates the NULL value.The data type of the host variables must be compatible with the data type of the associated field name.
Examples
exec sql GET DESCRIPTOR 'SQLA' :cnt = COUNT; exec sql GET DESCRIPTOR 'SQLA' VALUE 1 :hostvar1 = DATA;For more information, see the Mimer SQL Programmer's Manual, SQL Descriptor Area.
Standard Compliance
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|