14.5.3 Output format for field data
The table below describes the output format for field data by data type.
In the case of the null value, no data is output regardless of the data type. The plus sign (+) is not output for numeric data.
No. |
Data type |
Output format for field data |
|
---|---|---|---|
1 |
Numeric data |
INTEGER |
|
2 |
SMALLINT |
||
3 |
DECIMAL |
|
|
4 |
DOUBLE PRECISION |
|
|
5 |
Character string data |
CHAR |
|
6 |
VARCHAR |
|
|
7 |
Datetime data |
DATE |
|
8 |
TIME |
|
|
9 |
TIMESTAMP |
|
|
10 |
Binary data |
BINARY |
|
11 |
VARBINARY |
|
- Note
-
-
If you want to output datetime data in the format YYYY/MM/DD, specify a CONVERT scalar function in the selection expression in the SELECT statement that is specified in the SQL statement file. For details about the CONVERT scalar function, see Scalar Functions in the manual HADB SQL Reference.
Example 1: Exporting date data of the DATE type in column C1 in the format YYYY/MM/DD
SELECT CONVERT("C1",CHAR(10),'YYYY/MM/DD'), "C2" FROM "T1"
Example 2: Exporting time stamp data of the TIMESTAMP type in column C1 in the format YYYY/MM/DDhh:mm:ss
SELECT CONVERT("C1",CHAR(19),'YYYY/MM/DD HH:MI:SS'), "C2" FROM "T1"
-
If you want to output binary data in binary format enclosed between enclosing characters, specify a BIN scalar function in the selection expression in the SELECT statement that is specified in the SQL statement file. For details about the BIN scalar function, see Scalar Functions in the manual HADB SQL Reference.
Example: If you want to output the binary data in column C1 in binary format
SELECT BIN("C1") FROM "T1"
-