Subject | External table, Timestamp field value padded? |
---|---|
Author | Bert_Herngreen |
Post date | 2009-09-14T13:47:45Z |
Hello,
I have a question regarding external tables.
Why is the Timestamp field value padded with 'zero' when it is combined
with
(var)char fields?
When I create a table with a field of char only (case 1) or timestamp
only (case
2) , the field values are as I expected, but when they are combined
(case 3)
extra zero's are inserted.
case 1:
CREATE TABLE EXT_CHAR_21 EXTERNAL 'C:\TEMP\EXT_CHAR_21.TXT' (
F1 CHAR(21)
);
INSERT INTO EXT_CHAR_21 (F1) VALUES ('A string');
Hexdump of external table:
41 20 73 74 72 69 6E 67 20 20 20 20 20 20 20 20
20 20 20 20 20
case 2:
CREATE TABLE EXT_TIMESTAMP EXTERNAL 'C:\TEMP\EXT_TIMESTAMP.TXT' (
F1 TIMESTAMP
);
INSERT INTO EXT_TIMESTAMP (F1) VALUES ('14-SEP-2009 09:44:55');
Hexdump of external table:
30 D7 00 00 70 12 EB 14
case 3:
CREATE TABLE EXT_CHAR_21_TIMESTAMP EXTERNAL
'C:\TEMP\EXT_CHAR_21_TIMESTAMP.TXT'
(
F1 CHAR(21),
F2 TIMESTAMP
);
INSERT INTO EXT_CHAR_21_TIMESTAMP (F1,F2) VALUES ('A
string','14-SEP-2009
09:44:55');
Hexdump of external table:
41 20 73 74 72 69 6E 67 20 20 20 20 20 20 20 20
20 20 20 20 20 00 00 00 00 00 00 00 30 D7 00 00
-- -- -- -- -- -- --
70 12 EB 14
Kind regards,
Bert
[Non-text portions of this message have been removed]
I have a question regarding external tables.
Why is the Timestamp field value padded with 'zero' when it is combined
with
(var)char fields?
When I create a table with a field of char only (case 1) or timestamp
only (case
2) , the field values are as I expected, but when they are combined
(case 3)
extra zero's are inserted.
case 1:
CREATE TABLE EXT_CHAR_21 EXTERNAL 'C:\TEMP\EXT_CHAR_21.TXT' (
F1 CHAR(21)
);
INSERT INTO EXT_CHAR_21 (F1) VALUES ('A string');
Hexdump of external table:
41 20 73 74 72 69 6E 67 20 20 20 20 20 20 20 20
20 20 20 20 20
case 2:
CREATE TABLE EXT_TIMESTAMP EXTERNAL 'C:\TEMP\EXT_TIMESTAMP.TXT' (
F1 TIMESTAMP
);
INSERT INTO EXT_TIMESTAMP (F1) VALUES ('14-SEP-2009 09:44:55');
Hexdump of external table:
30 D7 00 00 70 12 EB 14
case 3:
CREATE TABLE EXT_CHAR_21_TIMESTAMP EXTERNAL
'C:\TEMP\EXT_CHAR_21_TIMESTAMP.TXT'
(
F1 CHAR(21),
F2 TIMESTAMP
);
INSERT INTO EXT_CHAR_21_TIMESTAMP (F1,F2) VALUES ('A
string','14-SEP-2009
09:44:55');
Hexdump of external table:
41 20 73 74 72 69 6E 67 20 20 20 20 20 20 20 20
20 20 20 20 20 00 00 00 00 00 00 00 30 D7 00 00
-- -- -- -- -- -- --
70 12 EB 14
Kind regards,
Bert
[Non-text portions of this message have been removed]