Scalable Database Server, HiRDB Version 8 Command Reference
column-name[{[,type=data-type
[,null={'numeric-comparison-value'|(begin-position,{c|x}'comparison-value)}]]
[,element=elements-count][,elmtype=arrayed-data-format]
[,nullset=null-value-option][,mode={text|bin}]
[,enclose_del={yes|no}][,filldata=filler-data]
|[,func=([authorization-identifier.]function-name
,param=argument-type[,type=data-type
[,null={'numeric-comparison-value'|(begin-position,{c|x}'comparison-value')}]]
[,mode={text|bin}][,enclose_del={yes|no}]
[,filldata=filler-data]
[,param=argument-type[,type=data-type
[,null={'numeric-comparison-value'|(begin-position,{c|x}'comparison-value')}]]
[,mode={text|bin}][,enclose_del={yes|no}]
[,filldata=filler-data]]...)]
}]
|
Some of the column name statement's operands are not specifiable depending on the format of input data file. The following table shows whether each operand is specifiable for each format.
| Type of specified column | Operand | Input data format | ||
|---|---|---|---|---|
| DAT format | Fixed-size data format | pdrorg-generated binary format | ||
| Predefined type (column specification) | column-name | R | R | R |
| type | N | R | O3 | |
| null | N | O | O | |
| element | O | O | N | |
| elmtype | O | O | N | |
| nullset | O | O | N | |
| mode | N | O4 | N | |
| enclose_del | N | O5 | N | |
| filldata | N | O | N | |
| Abstract data type (function specification) | column-name | R | R | R |
| func | O1 | O1 | O1 | |
| param | O2 | O2 | O2 | |
| type | N | O2 | O3 | |
| null | N | O | O | |
| mode | N | O4 | N | |
| enclose_del | N | O5 | N | |
| filldata | N | O | N | |
R: Required
O: Optional
N: Not specifiable
1 Required if a function is specified.
2 Required if the func operand is specified with the function.
3 Specifiable if the data type of the column or the data specified in param with function specification is BLOB or BINARY. If any one of the following conditions is applicable, make sure that the operand is specified:
4 Specifiable only when the type operand value is char and the table definition is CHAR or MCHAR.
5 Specifiable only when the type operand value is char and the table definition is VARCHAR or MVARCHAR.
Specifies the name of the table column in which input data is to be stored.
If the column-name is enclosed in double quotation marks ("), it is treated as being case sensitive; otherwise, it is treated as all uppercase letters. If the column-name contains a space, enclose the entire column-name in double quotation marks.
Specifies the data type of the column in the input data. For the data types for columns in input data, see (3) Specification of data types and argument types. To determine whether or not the input data is stored in the database when the data type specified in the column structure information file does not match the data type of the table column, see (4) Data storage in the database when the data type specified in the column structure information file does not match the data type in the table.
Specifies that the null value is to be stored in specified columns of the table.
Because the column data is compared with the input data, specify a comparison value that corresponds to the data type specified in the type operand.
The available comparison method depends on the type of input data. The following table shows the comparison method for each type of input data:
| Input data type | Comparison method | ||
|---|---|---|---|
| Numeric comparison | Character comparison | Hexadecimal comparison | |
| DECIMAL | Y | N | Y |
| DATE | Y | N | Y |
| INTERVAL YEAR TO DAY | Y | N | Y |
| TIME | Y | N | Y |
| INTERVAL HOUR TO SECOND | Y | N | Y |
| TIMESTAMP | Y | N | Y |
| CHAR | N | Y | Y |
| VARCHAR | N | Y | Y |
| NCHAR | N | Y | Y |
| NVARCHAR | N | Y | Y |
| MCHAR | N | Y | Y |
| MVARCHAR | N | Y | Y |
| BINARY | N | Y | Y |
| BLOB | N | Y | Y |
| INTEGER | Y | N | Y |
| SMALLINT | Y | N | Y |
| FLOAT | Y | N | Y |
| SMALLFLT | Y | N | Y |
| yymmdd format | Y | N | Y |
| yy-mm-dd format | N | Y | Y |
| Input data of CHAR(5) | Result of comparison with null=(2,'XYZ') | Handling of input data |
|---|---|---|
| *XYZ* | Perfectly matches the comparison value. | Treated as the null value. |
| XYZ** | Matches the comparison value, but the beginning position does not match. | Treated as the input data. |
| *XY** | Does not match the comparison value. |
| Data type of column | Value treated as the null value | Specification following the part null= |
|---|---|---|
| DECIMAL | Character string NULL | (1,x'4e554c4c') |
| DATE | 0000-00-00 | (1,x'00000000') |
| INTERVAL YEAR TO DAY | Byte 1 is 0xff. | (1,x'ff') |
| TIME | 99:99:99 | (1,x'999999') |
| INTERVAL HOUR TO SECOND | Byte 2 is 0xff. | (2,x'ff') |
| TIMESTAMP | Bytes 2 and 3 are 0xff. | (2,x'ffff') |
| INTEGER* | Character string NULL | (1,x'4e554c4c') |
| SMALLINT* | Character string NL | (1,x'4e4c') |
| FLOAT* | Character string **NULL** | (1,x'2a2a4e554c4c2a2a') |
| SMALLFLT* | Character string NULL | (1,x'4e554c4c') |
<1 to number of elements specified for the corresponding column in table definition>
For a repetition column, specify the number of elements to be specified in the input data file.
Specify the element operand if the number of elements specified in the input data file is less than the number of elements specified for the corresponding column during table definition.
If the element operand is omitted, the system assumes the maximum number of elements specified for the corresponding column during table definition.
For a repetition column, specify its array data format.
This specifies how null value storage is to be handled if a null value is specified from an element through the end of specified elements for an FF arrayed data format.
Specifies the input data storage method when the input data is a fixed-length character string (type=char(n)) and the column data type of the storage target is CHAR or MCHAR. This operand is applicable only to the fixed-size data format.
Specifies the input data storage method when the input data is a fixed-length character string (type=char(n)) and the column data type of the storage target is VARCHAR or MVARCHAR. This operand is applicable only to the fixed-size data format.
Specifies the trailing filler data that is to be used when BINARY data is specified as CHAR type in the fixed-size data format. The filler data is 1-byte data in the range 0-255 expressed in hexadecimal (X'00" to X'ff'). When this operand is omitted, 0 is assumed.
If a specified column name has an abstract data type, this operand specifies information about the constructor function that generates the values to be stored.
For data storage in the database when the input parameter specified in the column structure information file has a different data type than the argument of the constructor function to be called, see (4) Data storage in the database when the data type specified in the column structure information file does not match the data type in the table.
Table 5-27 shows the method for specifying data types and argument types.
Table 5-27 Specification of data types and argument types
| Specification | Remarks |
|---|---|
| integer | |
| smallint | |
| char(n)1, 2 | n indicates the CHAR or MCHAR length in bytes; m indicates the NCHAR length in digits. These values may not match the column length defined for the target table. If converting characters to numeric values, do not include the null character (\0) in the character string. For the param operand, omit (n) and (m). |
| nchar(m)1 | |
| mchar(n)1 | |
| varchar(n)1 | n indicates the maximum length of VARCHAR or MVARCHAR in bytes; m indicates the maximum length of NVARCHAR in digits. These values may not match the column length defined for the target table. For the param operand, omit (n) and (m). |
| nvarchar(m)1 | |
| mvarchar(n)1 | |
| float | |
| smallflt | |
| dec (precision [, decimal-places]) |
For the param operand, omit the precision and scaling factor. |
| date | |
| interval-year-to-day | |
| time | |
| interval-hour-to-second | |
| yy-mm-dd1, 3 | You can use this format only when storing character data indicating the last two digits of the year in a DATE-type column. Any one-byte character can be specified as the separator between the year, month, and date (e.g., yy-mm-dd or yy/mm/dd). |
| yymmdd3 | You can use this format only when storing the unsigned packed-format data indicating the last two digits of the year in a DATE-type column. |
| timestamp(p) | p indicates the length of the fraction part for seconds (0, 2, 4, or 6). For the param operand, omit (p). |
| binary(n) | n indicates the maximum length of the BINARY type in bytes. For the param operand, omit (n). |
| binaryprm | For an input data file in pdrorg-generated binary format, you can use this type in the type operand. When skipping abstract data-type data, if the abstract data type is the BINARY-type parameter, use this type in the type operand of the skipdata statement. A control statement error results if this type is specified in an operand other than the type operand of the skipdata statement for an input data file in pdrorg-generated binary format. |
| blob(n) |
|
| blobprm | For an input data file in the pdrorg-generated binary format, you can use this format in the type operand. When unloading an abstract data type, use this format for the BLOB parameter data that has been unloaded. |
1 Specify a left-justified column value.
2 If the characters are to be converted to a numeric value, there is no need to left-justify them.
3 The last two digits of the year are expanded to the format 19yy and then stored.
Tables 5-28 and 5-29 show whether or not input data is stored in database if the data type specified in the column structure information file does not match the data type in the table.
Table 5-28 Data storage in the database when the data type specified in the column structure information file does not match the data type in the table (1/2)
| Data type specified in column structure information file | Data type in table | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| IN | SI | CH | NC | MC | VC | NV | MV | FL | SM | |
| integer | Y | |||||||||
| smallint | Y | |||||||||
| char | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| nchar | Y | |||||||||
| mchar | Y | |||||||||
| varchar | Y | |||||||||
| nvarchar | Y | |||||||||
| mvarchar | Y | |||||||||
| float | Y | |||||||||
| smallflt | Y | |||||||||
| dec | ||||||||||
| date | ||||||||||
| interval-year- to-day | ||||||||||
| time | ||||||||||
| interval-hour- to-second | ||||||||||
| timestamp | ||||||||||
| binary | ||||||||||
| yy-mm-dd | ||||||||||
| yymmdd | ||||||||||
| blob | ||||||||||
Table 5-29 Data storage in the database when the data type specified in the column structure information file does not match the data type in the table (2/2)
| Data type specified in column structure information file | Data type in table | |||||||
|---|---|---|---|---|---|---|---|---|
| DEC | DATE | IYTD | TIME | IHTS | TMST | BIN | BLOB | |
| integer | ||||||||
| smallint | ||||||||
| char | Y | Y | Y | Y | Y | Y | Y | Y |
| nchar | ||||||||
| mchar | ||||||||
| varchar | ||||||||
| nvarchar | ||||||||
| mvarchar | ||||||||
| float | ||||||||
| smallflt | ||||||||
| dec | Y | |||||||
| date | Y | |||||||
| interval-year-to-day | Y | |||||||
| time | Y | |||||||
| interval-hour-to-second | Y | |||||||
| timestamp | Y | |||||||
| binary | Y | |||||||
| yy-mm-dd | Y | |||||||
| yymmdd | Y | |||||||
| blob | Y* | Y | ||||||
* Data can be stored for an input data file in the pdrorg-created binary format.
The following table provides examples of type operand specification in the column name statement for an input data file in pdrorg-generated binary format:
| Input data type | Data type after conversion | |||
|---|---|---|---|---|
| BLOB type | BLOB parameter | BINARY type | BINARY parameter | |
| BLOB type | func=(F_BLOB, param=blob) |
type=blob | func=(F_BIN, param=binary, type=blob) |
|
| BLOB parameter | type=blobprm | func=(F_BLOB, param=blob) |
type=blobprm | func=(F_BIN, param=binary, type=blobprm) |
| BINARY type | N | N | N | |
| BINARY parameter | N | N | N | func=(F_BIN, param=binary) |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.