Scalable Database Server, HiRDB Version 8 UAP Development Guide
Execution of the DESCRIBE statement converts distributed server data types into the corresponding HiRDB data types. The results are set in the SQL Descriptor Area. If no corresponding HiRDB data type exists for a particular distributed server data type, data code 0 is set in SQLDA.
A UAP must be created so that the DESCRIBE statement is executed first, then the desired column in the table at the distributed server can be accessed using variables of the appropriate data types that are set in the SQL Descriptor Area. However, there are some exceptions to this rule (e.g., accessing a DATE-type column using a CHAR-type variable).
Table 11-7 shows the relationships between the data types that are set in the SQL Descriptor Area of a HiRDB distributed client after the DESCRIBE statement has executed and the data types of HiRDB.
Table 11-7 Data types set in SQL Descriptor Area of HiRDB after execution of DESCRIBE statement in the case of a HiRDB distributed server
HiRDB data type | Data type set in SQL Descriptor Area of HiRDB | Description |
---|---|---|
INTEGER | INTEGER | Integer (4-byte binary format) |
SMALLINT | SMALLINT | Integer (2-byte binary format) |
DECIMAL (p, s) | DECIMAL (p, s) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 1 p 29, 0 s p |
FLOAT | FLOAT | Double-precision floating-point number |
SMALLFLT | SMALLFLT | Single-precision floating-point number |
CHAR (n) | CHAR (n) | Fixed-length character string |
VARCHAR (n) | VARCHAR (n) | Variable-length character string |
NCHAR (n) | NCHAR (n) | Fixed-length national character string |
NVARCHAR (n) | NVARCHAR (n) | Variable-length national character string |
MCHAR (n) | MCHAR (n) | Fixed-length mixed character string |
MVARCHAR (n) | MVARCHAR (n) | Variable-length mixed character string |
DATE1 | DATE | Date |
TIME2 | TIME | Time |
INTERVAL YEAR TO DAY | INTERVAL YEAR TO DAY | Date interval |
INTERVAL HOUR TO SECOND | INTERVAL HOUR TO SECOND | Time interval |
BLOB | BLOB | Binary |
ROW | ROW | ROW type |
Table 11-8 shows the relationships between the data types that are set in the SQL Descriptor Area of a HiRDB distributed client after the DESCRIBE statement has executed and the data types of XDM/RD.
Table 11-8 Data types set in SQL Descriptor Area of HiRDB after execution of DESCRIBE statement in the case of an XDM/RD distributed server
XDM/RD data type | Data type set in SQL Descriptor Area of HiRDB | Description |
---|---|---|
INTEGER | INTEGER | Integer (4-byte binary format) |
SMALLINT | SMALLINT | Integer (2-byte binary format) |
DECIMAL (p, s) | DECIMAL (p, s) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 1 p 29, 0 s p |
LARGE DECIMAL (p, s) | ||
FLOAT | FLOAT | Double-precision floating-point number |
SMALLFLT | SMALLFLT | Single-precision floating-point number |
CHAR (n) | CHAR (n) | Fixed-length character string |
VARCHAR (n) | VARCHAR (n) | Variable-length character string |
LONG VARCHAR (n) | ||
NCHAR (n) | NCHAR (n) | Fixed-length national character string |
NVARCHAR (n) | NVARCHAR (n) | Variable-length national character string |
LONG NVARCHAR (n) | ||
MCHAR (n) | MCHAR (n) | Fixed-length mixed character string |
MVARCHAR (n) | MVARCHAR (n) | Variable-length mixed character string |
LONG MVARCHAR (n) | ||
DATE1 | DATE | Date |
TIME2 | TIME | Time |
INTERVAL YEAR TO DAY | INTERVAL YEAR TO DAY | Date interval |
INTERVAL HOUR TO SECOND | INTERVAL HOUR TO SECOND | Time interval |
ROW | ROW | ROW type |
Table 11-9 shows the relationships between the data types that are set in the SQL Descriptor Area of a HiRDB distributed client after the DESCRIBE statement has executed and the data types of ORACLE.
Table 11-9 Data types set in SQL Descriptor Area of HiRDB after execution of DESCRIBE statement in the case of an ORACLE distributed server
ORACLE data type | Data type set in SQL Descriptor Area of HiRDB | Description |
---|---|---|
NUMBER (p, s) | DECIMAL (p, s) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 1 p 29, 0 s p |
NUMBER (p, s)1 | DECIMAL (p, 0) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 1 p 29, s < 0 |
NUMBER (p, s)2 | DECIMAL (p, p) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 1 p 29, s > p |
NUMBER3 | FLOAT | Double-precision floating-point number |
NUMBER (p, s)4 | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal point) = s 30 p 38, 0 s p |
|
CHAR (n) | CHAR (n) | Fixed-length character string n 255 |
VARCHAR2 (n) | VARCHAR (n) | Variable-length character string n 2000 |
LONG | VARCHAR (32000)5 | Variable-length character string |
DATE6 | DATE | Date |
ROW | Data code 0 | Data code 0 is set in SQLDA because no corresponding data type is found in the HiRDB database. |
LONG ROW | ||
ROWID | ||
MLSLABEL |
Table 11-10 shows the relationships between the data types that are set in the SQL Descriptor Area of a HiRDB distributed client after the DESCRIBE statement has been executed and the data types of RDB1 E2.
Table 11-10 Data types set in SQL Descriptor Area of HiRDB after execution of DESCRIBE statement in the case of an RDB1 E2 distributed server
RDB1 E2 data type | Data type set in SQL Descriptor Area of HiRDB | Description |
---|---|---|
INTEGER | INTEGER | Integer (4-byte binary format) |
SMALLINT | SMALLINT | Integer (2-byte binary format) |
DECIMAL (p, s) | DECIMAL (p, s) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal number) = s 1 p 29, 0 s p |
FLOAT | FLOAT | Double-precision floating-point number |
SMALLFLT | SMALLFLT | Single-precision floating-point number |
CHAR (n) | CHAR (n) | Fixed-length character string n 254 |
VARCHAR (n) | VARCHAR (n) | Variable-length character string n 254 |
LONG VARCHAR (n) | VARCHAR (n) | Variable-length character string 255 n 4000 |
NCHAR (n) | NCHAR (n) | Fixed-length national character string n 127 |
NVARCHAR (n) | NVARCHAR (n) | Variable-length national character string n 127 |
ROW | ROW | ROW type |
Table 11-11 shows the relationships between the data types that are set in the SQL Descriptor Area of a HiRDB distributed client after the DESCRIBE statement has been executed and the data types of SQL/K.
Table 11-11 Data types set in SQL Descriptor Area of HiRDB after execution of DESCRIBE statement in the case of an SQL/K distributed server
SQL/K data type | Data type set in SQL Descriptor Area of HiRDB | Description |
---|---|---|
INTEGER | INTEGER | Integer (4-byte binary format) |
SMALLINT | SMALLINT | Integer (2-byte binary format) |
DECIMAL (p,s) | DECIMAL (p,s) | Fixed-point number Precision (total number of digits) = p Scale factor (number of digits following the decimal number) = s 1 p 29, 0 s p |
CHAR (n) | CHAR (n) | Fixed-length character string n 32000 |
CHAR (n) | CHAR(32000)1 | Fixed-length character string n > 32000 |
NCHAR (n) | NCHAR (n) | Fixed-length national character string n 16000 |
NCHAR (n) | NCHAR (16000)2 | Fixed-length national character string n > 16000 |
MCHAR (n) | MCHAR (n) | Fixed-length mixed character string n 32000 |
MCHAR (n) | MCHAR(32000)1 | Fixed-length mixed character string n > 32000 |
LARGE INT | Data code 0 | Data code 0 is set in SQLDA because no corresponding data type is found in the HiRDB database. |
NUMERIC TRAILING (P,S) |
||
NUMERIC UNSIGNED (P,S) |
||
XCHAR (n) BIT (n) |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.