Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Date using Teradata Sql Assistant

Status
Not open for further replies.

Rvir

Programmer
May 16, 2007
18
US
Iam trying to insert a record in a table using teradata sql assistant import option. This record in a file has date field in it and the number of columns values in the file match with the table structure.When i try to import
iam running to issue .It says something about the invalid data in the date field .Is there any way to do the date field import from the file?

I tried
insert into dbcname.tblname (?,?,?,?,?)
i've the date in 4th and 5th column
failed saying invalid date

 
The date needs to be in the same format as the default format of the field in the table or you need to tell teradata what format the date is in.
Help table dbcname.tblname should give you the format of the date field (for example yyyy-mm-dd). If you change the format of the date in the text file to the same, it should work.
Alternatively:
insert into dbcname.tblname (?,?,?,cast(? as date format 'dd-mm-yyyy'),cast(? as date format 'dd-mm-yyyy'))
[where 'dd-mm-yyyy' is the date format of the data in the text file] will enable you to use the text file as-is.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top