All Forums Database
aurness 3 posts Joined 01/14
15 Jan 2014
Issues with importing file with Date to Table

Hello -
I'm trying to import a TXT file (CSV converted to Tab Deliminated) to a table and keep running into issues with the date. I am fairly new to using Teradata or any Database tools, but can't seem to figure out this issue - either by reading, researching online, or talking with peers who have much more experience.
If there are any thoughts on how I can get this resolved, and import the data with the date, that would be awesome.
I have put my table and sample data below, the "*" are where I have removed the actual titles.
My Table


***ID VARCHAR (24),


***ID VARCHAR (9),

**e VARCHAR (25),

**r VARCHAR (25),

***_ITEM VARCHAR (10),




Sample of my data file

***ID Survey_Date ***ID **e **r ***_ITEM SAt***

FV4dc89kYpdRh8F9dkxJgA4C 20130903 45-54 Female No 100

QAdlg4dwIV40dBwII4sAEQ4C 20130903 65+ Female No 100

Ic0h8ElxEMRRooIN4okwow4C 20130903 55-64 Male No 96


sgarlapa 88 posts Joined 03/13
15 Jan 2014

seems your default date format in target talble and the data formt in source file are different.
while importing you may have to use below format converstion in insert statment -
cast(:survey_date as date format 'yyyymmdd')
and i hope you don't have header in your datafile.

Raja_KT 1246 posts Joined 07/09
16 Jan 2014

You have not shared you script settings.
Are you using setting like :
.import vartext file=/home/adc.dat;using id(varchar(20)) .....
Also, you can think of using CSVLD function too.

Raja K Thaw
My wiki:
Street Children suffer not by their fault. We can help them if we want.

KVB 124 posts Joined 09/12
16 Jan 2014

Probably that might be the case.Date formats are different in source and target.Check with the delimiter too in the options tab.

You must sign in to leave a comment.