A Rexx interface to SQL databases
10 October 2006
Describes the expressions returned by a SELECT statement. The statement should
first be prepared (with
and then described.
Creates a compound variable for each column in the select list of the sql
statement, with a stem equal to the statement name, followed by
'COLUMN' and with at least the following column attributes: NAME, TYPE,
SIZE, SCALE, PRECISION, NULLABLE.
- NAME - name of the column
- TYPE - the datatype of the column represented as a database-specific string
- SIZE - the size of the column as known to the database
- SCALE - the overall size of the column
- PRECISION - the column's precision; usually the number of decimal places
- NULLABLE - 1 if the column allows NULL values, 0 otherwise
The full list of column attributes can be obtained by calling
SQLVARIABLE with the DESCRIBECOLUMNS
See the database-specific appendix for the meaning of other column attributes returned.
- statement name
- A name to identify the sql statement.
- stem name
- An optional name specifying the stem name of the Rexx variables created.
- success: a positive number, or zero, indicating the number of expressions
in the select list of the SELECT statement
- failure: a negative number
rc = sqlprepare(s2,"select ename, empno from emp")
rc = sqldescribe(s2,"AA")
results in the following Rexx variables being set:
- AA.COLUMN.NAME.1 == "ENAME"
- AA.COLUMN.NAME.2 == "EMPNO"
- AA.COLUMN.TYPE.1 == "VARCHAR2"
- AA.COLUMN.TYPE.2 == "NUMBER"
- AA.COLUMN.SIZE.1 == "20"
- AA.COLUMN.SIZE.2 == "6"
- AA.COLUMN.PRECISION.1 == "20"
- AA.COLUMN.PRECISION.2 == "40"
- AA.COLUMN.SCALE.1 == "0"
- AA.COLUMN.SCALE.2 == "0"
- AA.COLUMN.NULLABLE.1 == "1"
- AA.COLUMN.NULLABLE.2 == "0"
The values returned are implementation dependant.
Mark Hessling 1997-2006
Return to Table of Contents
Last updated 10 October 2006