|
|
Archives of the TeradataForum
Message Posted: Wed, 19 Oct 2011 @ 10:25:27 GMT
Subj: | | Re: Insert CHAR to TIMESTAMP |
|
From: | | Singh, Sudhansu |
ct t (i int, j timestamp(6));
*** Table has been created.
*** Total elapsed time was 1 second.
ins t(1, CAST( SUBSTR('20110923 152959',1,4) || '-' || SUBSTR('20110923
152959',5,2) || '-' || SUBSTR('20110923 152959',7,2) || ' ' ||
SUBSTR('20110923 152959',10,2) || ':' || SUBSTR('20110923 152959',12,2) || ':' ||
SUBSTR('20110923 152959',14,2) AS TIMESTAMP(0) ));
*** Insert completed. One row added.
*** Total elapsed time was 1 second.
BTEQ -- Enter your SQL request or BTEQ command:
sel * from t;
sel * from t;
*** Query completed. One row found. 2 columns returned.
*** Total elapsed time was 1 second.
i j
----------- --------------------------
1 2011-09-23 15:29:59.000000
BTEQ -- Enter your SQL request or BTEQ command:
regards,
Sudhansu
| |