Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 28 Oct 2012 @ 19:11:36 GMT


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


Subj:   Re: How to Convert a VARCHAR date into TIMESTAMP(0) format
 
From:   Lenka, Dipti Prakash

Thank u Guyz. It is working when I ran it in SQL Assistance.

But it wont work in MLOAD script if I use CAST('20121024 11:46:29' AS TIMESTAMP(0) FORMAT 'YYYYMMDDBhh:mi:ss');

Basically the '20121024 11:46:29' values I am receiving in extract file. When I am trying to insert into my Mlaod table which is having column award_date_time TIMESTAMP(0), it is throwing me an error ""6760 - Invalid timestamp

My code :

     .LAYOUT total_spent_layout;

     .FIELD   f_award_date_time          * VARCHAR(19) ;

     .DML LABEL Inserts;

     INSERT INTO TTMMPPDDBB.TTMMPPEENNVV_total_spent_ml
     (
      journal_id
     ,as_of_date_time
     ,award_amt_ent
     ,award_date_time
     )
     VALUES
     (
      :f_journal_id
     ,null
     ,:f_award_amt_ent
     ,:f_award_date_time
     );

     .IMPORT INFILE TOTSPE01.dat
     FORMAT VARTEXT '|'
     DISPLAY ERRORS
     NOSTOP
     LAYOUT total_spent_layout
     APPLY Inserts
     ;

If I make the table column datatype VARCHAR(20) then the date gets loaded without time. But I need the date with timstamp.

Please advice.


Thanks,

Dipti Prakash



     
  <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: 23 Jun 2019