All Forums Database
tty 7 posts Joined 08/06
31 Aug 2006
Fastload Varchar to Timestamp

Hi,I'm writing a fastload to load from a comma delimited file. I'm using SET RECORD VARTEXT in the script to load from the file.The loading returns an error when it attempts to load into a timestamp(0) column in the new table.The source timestamp data looks like this : 5/16/2005 9:44:44 PM. How do I convert this to timestamp for it to be loaded into the new table?An extract of my fastload script looks like this:...SET RECORD VARTEXT ",";...CREAT TABLE MyTable ( MyTimestamp TIMESTAMP(0) ...)...DEFINE in_MyTimestamp (VARCHAR(255)) ...INSERT INTO MyNewTable VALUES( :in_MyTimestamp (FORMAT 'someformat...') ...)Any help appreciated! Thanks!TTY

dnoeth 4628 posts Joined 11/04
31 Aug 2006

Hi tty,a cast using a format string will only work, if it's always 2 digits for day/month/hour likeselect '05/16/2005 09:44:44 PM' (timestamp, format 'mm/dd/yyyyBhh:mi:ssBT')If you can't reformat the source data you'll probably need an INMOD.Dieter

Dieter

tty 7 posts Joined 08/06
31 Aug 2006

Hi dnoeth,Thanks for the tip! Seems like changing the source will be my best option for now. Thanks again.Ty

narang.mohit 13 posts Joined 07/09
02 Feb 2010

there should be some method of formating the timestamp column at source to make compatible to the teradata timestamp columni mean in my flat file the data is coming like dd-mm-yyyy 00:00:00 but fastload fails with timestamp errorI tried putting the in the insert statemnt (TIMESTAMP(6), FORMAT 'dd-mm-yyyyBHH:MI:SS')but with this also it is not workingm i using the coorect format in as above mentioned

You must sign in to leave a comment.