Appendix C.1 Foreign DB: HiRDB

Tables C-1 and C-2 show data type correspondences (foreign DB: HiRDB).

Table C-1 Data type correspondence (foreign DB: HiRDB) (1/2)

Data type of HiRDB (foreign DB)Data type of HiRDB
SMALLINTINTEGERDECIMAL(m,n)
1 [Figure] m [Figure] 29, 0 [Figure] n [Figure] m
SMALLFLTor REAL*1FLOAT or DOUBLE PRECISION1CHAR(n)
1 [Figure] n [Figure] 255
VARCHAR(n)
1 [Figure] n [Figure] 255
MCHAR(n)
1 [Figure] n [Figure] 255
MVARCHAR(n)
1 [Figure] n [Figure] 255
SMALLINTR

INTEGER

R

DECIMAL(p,s)
1 [Figure] p[Figure] 29
0 [Figure] s[Figure] p

R2,4

SMALLFLT or REAL

R

FLOAT or DOUBLE PRECISION

R

CHAR(n)
1 [Figure] n[Figure] 255

R3

CHAR(n)
256 [Figure] n[Figure] 30,000

VARCHAR(n)
1 [Figure] n[Figure] 255

R3

VARCHAR(n)
256 [Figure] n[Figure] 32,000

MCHAR(n)
1 [Figure] n[Figure] 255

R3

MCHAR(n)
256 [Figure] n[Figure] 30,000

MVARCHAR(n)
1 [Figure] n[Figure] 255

R3
MVARCHAR(n)
256 [Figure] n[Figure] 32,000

NCHAR(n)
1 [Figure] n[Figure] 127

NCHAR(n)
128 [Figure] n[Figure] 15,000

NVARCHAR(n)
1 [Figure] n[Figure] 127

VARCHAR(n)
128 [Figure] n[Figure] 16,000

DATE

TIME

TIMESTAMP(p)
p = 0, 2, 4, or 6

INTERVAL YEAR TO DAY

INTERVAL HOUR TO SECOND

BLOB

BINARY(n)
1 [Figure] n[Figure] 255

BINARY(n)
256 [Figure] n[Figure] 32,000

BINARY(n)
32,001 [Figure] n[Figure] 2,147,483,647

Legend:
R: Recommended data type
Blank: Not mappable data type
Note
If a character string type of 255 bytes is specified for a column greater than or equal to 256 bytes on a foreign server, only a maximum of 255 bytes of data can be acquired.
1 The precision of values that can be represented may be reduced. The scope and precision of values on HiRDB are hardware-dependent.
2 An error may occur if the number of digits in the integer part is less than the data type of HiRDB.
If the number of digits in the fractional part is less than the data type of HiRDB, data is acquired by truncating the excess fractional part to match the number of digits in the fractional part of the data type of HiRDB.
If the number of digits in the integer or fractional part is larger than the data type of HiRDB, data is acquired by zero-filling any extended portion to match the number of digits in the data type of HiRDB.
3 Make the definition length of the data type of the foreign server equal to that of HiRDB.
If the definition length (length = n bytes, n[Figure] 255) of the data type of HiRDB is less than the actual length of the data type of the foreign server, only the first n bytes are acquired.
If the definition length of the data type of HiRDB is greater, the data is inserted left-justified and any excess length is blank-filled (double-byte spaces for national character strings, single-byte spaces for character strings or mixed character strings), provided that HiRDB is of a fixed-length data type.
If HiRDB is of a variable-length data type, the data is acquired "as is."
4 If p and s are omitted, different foreign servers have different default precision and scaling. Therefore, the precision (p) and scaling (s) on the foreign server should be made equal to the precision (m) and the scaling (n) in the foreign table definition accordingly. When specifying these operands, make DECIMAL(m,n) equal to DECIMAL(p,s).

Table C-2 Data type correspondence (foreign DB: HiRDB) (2/2)

Data type of HiRDB (foreign DB)Data type of HiRDB
NCHAR(n)
1 [Figure] n [Figure] 127
NVARCHAR(n)
1 [Figure] n [Figure] 127
DATETIMETIMESTAMP(p)
p = 0, 2, 4, or 6
INTERVAL YEAR TO DAYINTERVAL HOUR TO SECONDBINARY(n)
1 [Figure] n [Figure] 255
SMALLINT

INTEGER

DECIMAL(p,s)
1 [Figure] p[Figure] 29
0 [Figure] s[Figure] p

SMALLFLT or REAL

FLOAT or DOUBLE PRECISION

CHAR(n)
1 [Figure] n[Figure] 255

CHAR(n)
256 [Figure] n[Figure] 30,000

VARCHAR(n)
1 [Figure] n[Figure] 255

VARCHAR(n)
256 [Figure] n[Figure] 32,000

MCHAR(n)
1 [Figure] n[Figure] 255

MCHAR(n)
256 [Figure] n[Figure] 30,000

MVARCHAR(n)
1 [Figure] n[Figure] 255

MVARCHAR(n)
256 [Figure] n[Figure] 32,000

NCHAR(n)
1 [Figure] n[Figure] 127
R1

NCHAR(n)
128 [Figure] n[Figure] 15,000

NVARCHAR(n)
1 [Figure] n[Figure] 127

R1

NVARCHAR(n)
128 [Figure] n[Figure] 16,000

DATE

R

TIME

R

TIMESTAMP(p)
p = 0, 2, 4, or 6

R2

INTERVAL YEAR TO DAY

R

INTERVAL HOUR TO SECOND

R

BLOB

BINARY(n)
1 [Figure] n[Figure] 255

R1
BINARY(n)
256 [Figure] n[Figure] 32,000

BINARY(n)
32,001 [Figure] n[Figure] 2,147,483,647

Legend:
R: Recommended data type
Blank: Not mappable data type
Note
If a character string type of 255 bytes is specified for a column greater than or equal to 256 bytes on a foreign server, only a maximum of 255 bytes of data can be acquired.
1 Make the definition length of the data type of the foreign server equal to that of HiRDB.
If the definition length (length = n bytes, n[Figure] 255) of the data type of HiRDB is less than the actual length of the data type of the foreign server, only the first n bytes are acquired.
If the definition length of the data type of HiRDB is greater, the data is inserted left-justified and any excess length is blank-filled (double-byte spaces for national character strings, single-byte spaces for character strings or mixed character strings), provided that HiRDB is of a fixed-length data type.
If HiRDB is of a variable-length data type, the data is acquired "as is."
2 The fractional second precision of data types on the foreign server must have the same fractional second precision as data types on HiRDB.
If the fractional second precision of data types on HiRDB is less, data is acquired by truncating the excess fractional second part to match the precision of data types on HiRDB.
If the fractional second precision of data types on HiRDB is greater, data is acquired by zero-filling the expanded fractional second part to match the precision of HiRDB data types.