HiRDB Dataextractor Version 8 Description, User's Guide and Operator's Guide
Among the files specified with the xtrep command, this section describes the contents of the following files:
Specify in the column name specification file a selection expression for the SELECT statement. For details about how to specify a selection expression with the SELECT statement, see the HiRDB SQL Reference manual.
extracts (column-name)
Specify in the table expression specification file the following clauses for the SELECT statement:
For details about how to specify the WHERE and ORDER BY clauses in the SELECT statement, see the HiRDB SQL Reference manual.
Specify the null value information file in the following cases:
{column-name|field-number=NUM}
[={HIGH|LOW|ZERO|SPACE|('literal')|
(X'hexadecimal-literal')}]
[,ARRAY={FF|FV|VV}[,NULLELM={C|E}]]
[,{NOCODECONV|CODECONV}]CLM01=HIGH #INT
CLM02=LOW #DATE
CLM03=('FFFF') #CHAR(4)
CLM04=SPACE,ARRAY=FV,NULLELM=E #CHAR(4)
CLM05, NOCODECONV
CLM06=(X'A4A2')Table 4-11 Default null value
| Data type | -v option omitted9 | -v option value | ||||||
|---|---|---|---|---|---|---|---|---|
| HIGH | LOW | ZERO | SPACE | Literal | Hexadecimal literal | |||
| INTEGER | -2147483648 | 2147483647 | -2147483648 | 0 | N | N | X'hexadecimal-literal' (4 bytes) | |
| SMALLINT | -32768 | 32767 | -32768 | 0 | N | N | X'hexadecimal-literal' (2 bytes) | |
| DECIMAL(p,s) | -99...99 | 99...99 | -99... 99 | 01 | N | N | X'hexadecimal-literal'((p + 1)/2 bytes) | |
| FLOAT | 2 | 3 | 2 | 0 | N | N | X'hexadecimal-literal' (8 bytes) | |
| SMALLFLT | 4 | 5 | 4 | 0 | N | N | X'hexadecimal-literal' (4 bytes) | |
| CHAR(n) VARCHAR(n) MCHAR(n) MVARCHAR(n) |
n < 4 | n bytes of '#' (single bytes) | N | N | N | n bytes of spaces (single bytes) |
literal (n bytes) |
X'hexadecimal-literal' (n bytes) |
| n |
4 bytes of '#' (single bytes) | N | N | N | 4 bytes of spaces (single bytes) |
literal (max. 255 bytes) |
X'hexadecimal-literal' (max. 127 bytes) | |
| NCHAR(n) NVCHAR(n) |
n < 2 (n = 1) |
2 bytes of '#' (double bytes)6 | N | N | N | 2 bytes of a space (double bytes)6 | literal (2 bytes) |
X'hexadecimal-literal'(2n bytes) |
| n |
4 bytes of '##' (double bytes)6 |
N | N | N | 4 bytes of spaces (double bytes)6 | literal (max. 254 bytes) |
X'hexadecimal-literal' (max 127 bytes) | |
| DATE | 0001- 01-01 | 9999- 12-31 | 0001- 01-01 | N | N | N | X'hexadecimal-literal' (4 bytes) | |
| INTERVAL YEAR TO DAY | -9999 yrs, 11 mos, 99 days | 9999 yrs, 11 mos, 99 days | -9999 yrs, 11 mos, 99 days | 0000 yrs, 00 mos, 00 days | N | N | X'hexadecimal-literal' (5 bytes) | |
| TIME | 00:00:00 | 23:59:59 | 00:00:00 | N | N | N | X'hexadecimal-literal' (3 bytes) | |
| INTERVAL HOUR TO SECOND |
-99 hrs, 59 mins, 59 secs | 99 hrs, 59 mins, 59 secs | -99 hrs, 59 mins, 59 secs | 00 hrs, 00 mins, 00 secs | N | N | X'hexadecimal-literal' (4 bytes) | |
| BLOB | XTNL0 | N | N | N | N | N | N | |
| BINARY(n) | n < 128 | X'00...00' (n bytes) |
X'FF...FF' (n bytes) | X'00...00' (n bytes) |
N | N | N | X'hexadecimal-literal ' (n bytes) |
| n |
X'00...00' (127 bytes) |
X'FF...FF' (127 bytes) | X'00...00' (127 bytes) |
N | N | N | X'hexadecimal-literal ' (max 127 bytes) | |
| TIMESTAMP(n) | 0001- 01-01 at 00:00:00.0000007 | 9999- 12-31 at 23:59:59.9999997 | 0001- 01-01 at 00:00:00.0000007 | N | N | N | X'hexadecimal-literal ' (7 + (n/2) bytes) | |
Table 4-12 Permitted combinations of ARRAY and NULLELM
| Function | Specified value | Permitted | Processing | ||
|---|---|---|---|---|---|
| Source | Target | ARRAY | NULLELM | ||
| HiRDB | HiRDB | FF |
-- | Y | Continues |
| C | |||||
| E | |||||
FV |
-- | ||||
| C | N | Error | |||
| E | |||||
VV |
-- | Y | Continues | ||
| C | N | Error | |||
| E | |||||
| Binary file | FF |
-- | Y | Continues | |
| C | N | Error | |||
| E | |||||
FV |
-- | Y | Continues | ||
| C | N | Error | |||
| E | |||||
VV |
-- | Y | Continues | ||
| C | N | Error | |||
| E | |||||
| DAT file | FF |
-- | Y | Continues | |
| C | N |
Error |
|||
| E | |||||
FV |
-- | ||||
| C | |||||
| E | |||||
VV |
-- | Y | Continues | ||
| C | N | Error | |||
| E | |||||
--: Not specified
Y: Permitted
Table 4-13 Null-value information file specification rules (applicable to data extraction from a HiRDB table)
| Specification in the null value information file | XTNLDFLT environment variable | ||||||
|---|---|---|---|---|---|---|---|
| 0 or 1 | 2 | ||||||
| Import to HiRDB | File creation | Import to HiRDB | File creation | ||||
| Binary format | DAT format | Binary format | DAT format | ||||
| column-name| field-number=NUM |
M | M | M | M | M | M | |
| =default-null-value | Y | Y | Y | N | N | N | |
| ARRAY= | FF | Y | Y | Y | N | N | Y |
| FV | Y | Y | N | N | N | N | |
| VV | Y | Y | Y | N | N | Y | |
| NULLELM={C|E} | Y | N | N | N | N | N | |
| NOCODECONV|CODECONV | Y | Y | Y | Y | Y | Y | |
Table 4-14 Relationship between the specified environment variable value and the default null value
Data type |
Default value when -v option is omitted | |
|---|---|---|
| Value specified in XTNLDFLT environment variable | ||
| 0 | 1 | |
| INTEGER | -2147483648 | Same as at left |
| SMALLINT | -32768 | Same as at left |
| DECIMAL | -99...99 | X'FF...FF' |
| FLOAT | 1 | Same as at left |
| SMALLFLT | 2 | Same as at left |
| CHAR(n) VARCHAR(n) MCHAR(n) MVARCHAR(n) |
When n n bytes of '#' When n > 4: 4 bytes of '#' |
Same as at left |
| NCHAR(n) NVARCHAR(n) |
When n n characters of '#' (double bytes) When n > 2: 2 characters of '#' (double bytes) |
Same as at left |
| DATE | 0001-01-01 | X'FFFFFFFF' |
| INTERVAL YEAR TO DAY | -9999 years, 11 months, and 99 days | X'FFFFFFFFFF' |
| TIME | 00:00:00 | X'FFFFFF' |
| INTERVAL HOUR TO SECOND | -99 hours, 59 minutes, and 59 seconds | X'FFFFFFFF' |
| BLOB | XTNL0 | Same as at left |
| BINARY(n) | When n <128: X'00...00' (n bytes) When n X'00...00' (127 bytes) |
Same as at left |
| TIMESTAMP(n) | 0001-01-01 at 00: 00:00.000000 3 | X'FF...FF' (7 + (N)/2 bytes) |
An output file is used to store extracted data. This section explains the format used by HiRDB Dataextractor to store extracted data in an output file. The specification format for an output file is based on the format of input files used by HiRDB's database load utility. There are two formats for an output file:
When you use the DAT format, specify the extracted data as character string data. The specification method is described below:
Table 4-15 shows the specification format of column data (DAT format) for each data type.
Table 4-15 Specification format of column data (DAT format)
| Data type | Specification format of column data | |
|---|---|---|
| Numeric data | INTEGER |
Decimal point (Example: -1.56 ... 0 ... 1.56) Floating point (Example: -2.4e+9 ... 0e0 ... 2.4e+9) |
| SMALLINT | ||
| DECIMAL | ||
| FLOAT | ||
| SMALLFLT | ||
| Character data | CHARACTER | Specify as a character string enclosed in double quotation marks ("). Example: "abcd" or "ABCD" For a variable-length data type that has a length of 0, specify "". |
| VARCHAR | ||
| National character string data | NCHAR | |
| NVARCHAR | ||
| Mixed character string data | MCHAR | |
| MVARCHAR | ||
| Date data | DATE | Specify in the numeric format yyyy-mm-dd. Example: January 1, 1998 |
| Date interval data | INTERVAL YEAR TO DAY | Specify in the numeric format [-]yyyymmdd. For a negative value, add a minus sign (-). Example: 1111 years, one month, one day |
| Time data | TIME | Specify in the numeric format hh:mm:ss. Example: 12:01:01 |
| Time stamp data | TIMESTAMP(n) n = 2, 4, 6 |
Specify in numeric format YYYY-MM-DD_hh:mm:ss.nnnnnn. YYYY: year, MM: month, DD: day, hh: hour, mm: minute, ss: second, nnnnnn: 0-6 decimal places for the second. _: Single-byte space (Example: 1997-10-15 at 15: 30:25.666666 |
| Time interval data | INTERVAL HOUR TO SECOND | Specify in the numeric format [-]hhmmss. For a negative value, add a minus sign (-). Example: 1 hour, 1 minute, 1 second |
| Large object data | BLOB | Specify the absolute pathname of the LOB input file. A LOB input file is created for each LOB data item and stored in the LOB input file storage directory. |
| BINARY(n) 1 |
|
|
| Abstract data type | SGMLTEXT | Specify the absolute pathname of the original text file. A LOB input file is created for each LOB data item and stored in the LOB input file storage directory. |
When you use the binary format, specify the extracted data in the storage format for the HiRDB database. The data format depends on the specification of the XTNLDFLT environment variable.
This subsection describes the data format that depends on the specification of the XTNLDFLT environment variable.
(i) When the XTNLDFLT environment variable is omitted or the value 0 or 1 is specified
Table 4-16 Specification format of column data (binary format)
| Data and parameter types | Column data specification format | |
|---|---|---|
| Numeric data | INTEGER, SMALLINT | |
| DECIMAL(m,n) 1 0 m |
||
| FLOAT, SMALLFLT | ||
| Character string data, National character string data, Mixed character string data | CHARACTER(n) VARCHAR(n) MCHAR(n) MVARCHAR(n) | |
| NCHAR(n) NVARCHAR(n) | ||
| Date data | DATE | |
| Date interval data | INTERVAL YEAR TO DAY | |
| Time data | TIME | |
| Time stamp data | TIMESTAMP(n) n = 0, 2, 4, 6 |
|
| Time interval data | INTERVAL HOUR TO SECOND | |
| Large object data | BLOB | |
| BINARY(n) 1 |
||
| Abstract data type | SGMLTEXT | |
(ii) When the value 2 is specified in the XTNLDFLT environment variable
See Figure 4-1.
Figure 4-1 Specification format of data when 2 is specified in the XTNLDFLT environment variable (binary format)
Explanation
Line length: In the 4-byte area, set the length from the beginning to the end of the last column data.
Offset: In the 4-byte area, set the length from the beginning of one column data item to the beginning of another.
For null-value data, 0 is set, and neither column data, nor large object data, nor abstract data is created.
Column data: Table 4-17 describes the specification format for each type of column data.
Large object or abstract data: Use one of the data types listed below that consists of the column data section containing the size and the real data at the end. The real data is stored in the following order; if there are multiple data items with the same data type, they are stored in the order defined:
1. BINARY
2. SGMLTEXT
3. BLOB
Table 4-17 Specification format of column data (when 2 is specified in XTNLDFLT environment variable)
| Data type | Column data specification format | |
|---|---|---|
| Large object data | BINARY | |
| BLOB | ||
| Abstract data type | SGMLTEXT | |
| Other | For the specification format of each data type, see Table 4-16. However, this does not apply when 2 is specified in the XTNLDFLT environment variable for repetition columns. For details, see Table 3-6 Data format of repetition columns during data import into a HiRDB table, and creation of a binary-format file when 2 is specified in the XTNLDFLT environment variable. | |
In the import information file, specify information about the columns whose data type is to be converted and the data types.
Specify the import information file in the following cases:
FORMAT
{FIELD_NUM field-number|FIELD_NAME column-name}ATTR data-type
[{FIELD_NUM field-number|FIELD_NAME}ATTR data-type]...Table 4-18 Data types permitted in ATTR
| Permitted data type | Corresponding data type | File creation | Import to HiRDB |
|---|---|---|---|
| INT | INTEGER | Y | N |
| SINT | SMALLINT | Y | N |
| DEC(m,n)2 | DECIMAL(m,n) | Y | N |
| FLT | FLOAT | Y | N |
| SFLT | SMALLFLT | Y | N |
| CHAR(n)3 | CHAR(n) | Y | N |
| VARCHAR(n)3 | VARCHAR(n) | Y | N |
| MCHAR(n)3 | MCHAR(n) | Y | N |
| MVARCHAR(n)3 | MVARCHAR(n) | Y | N |
| NCHAR(n)4 | NCHAR(n) | Y | N |
| NVARCHAR(n)4 | NVARCHAR(n) | Y | N |
| DATE | DATE | Y | N |
| TIME | TIME | Y | N |
| YEAR | INTERVAL YEAR TO DAY | Y | N |
| HOUR | INTERVAL HOUR TO SECOND | Y | N |
| BLOB(n[{K|M|G}])5 | BLOB(n[{K|M|G}]) | Y6 | Y7 |
| SGMLTEXT(n{K|M|G})5 | SGMLTEXT | Y6 | Y6 |
| BINARY(n)8 | BINARY(n) | Y6 | Y7 |
| TIMESTAMP(n)9 | TIMESTAMP(n) | Y | N |
| Unit | Range of n | Actual size (bytes) |
|---|---|---|
| None | 1 |
Same as at left |
| K | 1 |
n x 1024 |
| M | 1 |
n x 1048576 |
| G | 1 |
n x 1073741824 |
In the lock information file, specify the lock information for data extraction.
The information to be specified in the lock information file is shown below.
IN EXCLUSIVE MODE NOWAIT |
table-name IN EXCLUSIVE MODE NOWAIT |
Actual LOCK statement that is issued
LOCK TABLE table-name IN EXCLUSIVE MODE NOWAIT |
For details about how to specify the LOCK statement, see the manual HiRDB SQL Reference.
All rights reserved. Copyright (C) 2007, Hitachi, Ltd.