Certain predefined REXX data types correspond to DB2® database column types. Only these REXX data types can be declared as host variables. The following table shows how SQLEXEC and SQLDBS interpret REXX variables in order to convert their contents to DB2 data types.
SQL Column Type1 | REXX Data Type | SQL Column Type Description |
---|---|---|
SMALLINT |
A number without a decimal point ranging from -32 768 to 32 767 | 16-bit signed integer |
INTEGER |
A number without a decimal point ranging from -2 147 483 648 to 2 147 483 647 | 32-bit signed integer |
REAL2 |
A number in scientific notation ranging from -3.40282346 x 1038 to 3.40282346 x 1038 | Single-precision floating point |
DOUBLE3 |
A number in scientific notation ranging from -1.79769313 x 10308 to 1.79769313 x 10308 | Double-precision floating point |
DECIMAL(p,s) |
A number with a decimal point | Packed decimal |
CHAR(n) |
A string with a leading and trailing quotation mark ('), which
has length n after removing the two quotation marks A string of length n with any non-numeric characters, other than leading and trailing blanks or the E in scientific notation |
Fixed-length character string of length n where n is from 1 to 254 |
VARCHAR(n) |
Equivalent to CHAR(n) | Variable-length character string of length n, where n ranges from 1 to 4000 |
LONG VARCHAR5 |
Equivalent to CHAR(n) | Variable-length character string of length n, where n ranges from 1 to 32 700 |
CLOB(n) |
Equivalent to CHAR(n) | Large object variable-length character string of length n, where n ranges from 1 to 2 147 483 647 |
CLOB locator variable4 |
DECLARE :var_name LANGUAGE TYPE CLOB LOCATOR | Identifies CLOB entities residing on the server |
CLOB file reference |
DECLARE :var_name LANGUAGE TYPE CLOB FILE | Descriptor for file containing CLOB data |
BLOB(n) |
A string with a leading and trailing apostrophe, preceded by BIN, containing n characters after removing the preceding BIN and the two apostrophes. | Large object variable-length binary string of length n, where n ranges from 1 to 2 147 483 647 |
BLOB locator variable4 |
DECLARE :var_name LANGUAGE TYPE BLOB LOCATOR | Identifies BLOB entities on the server |
BLOB file reference |
DECLARE :var_name LANGUAGE TYPE BLOB FILE | Descriptor for the file containing BLOB data |
DATE |
Equivalent to CHAR(10) | 10-byte character string |
TIME |
Equivalent to CHAR(8) | 8-byte character string |
TIMESTAMP |
Equivalent to CHAR(26) | 26-byte character string |
XML |
SQL_TYP_XML |
There is no XML support for REXX; applications are able to get the describe type back but will not be able to make use of it. |
The following data types are only available in the DBCS environment.
SQL Column Type1 | REXX Data Type | SQL Column Type Description |
---|---|---|
GRAPHIC(n) |
A string with a leading and trailing apostrophe preceded by a G or N, containing n DBCS characters after removing the preceding character and the two apostrophes | Fixed-length graphic string of length n, where n is from 1 to 127 |
VARGRAPHIC(n) |
Equivalent to GRAPHIC(n) | Variable-length graphic string of length n, where n ranges from 1 to 2000 |
LONG VARGRAPHIC5 |
Equivalent to GRAPHIC(n) | Long variable-length graphic string of length n, where n ranges from 1 to 16 350 |
DBCLOB(n) |
Equivalent to GRAPHIC(n) | Large object variable-length graphic string of length n, where n ranges from 1 to 1 073 741 823 |
DBCLOB locator variable4 |
DECLARE :var_name LANGUAGE TYPE DBCLOB LOCATOR | Identifies DBCLOB entities residing on the server |
DBCLOB file reference |
DECLARE :var_name LANGUAGE TYPE DBCLOB FILE | Descriptor for file containing DBCLOB data |
Note:
|