Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 19 Oct 2011 @ 10:25:27 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023