Issues with importing file with Date to Table

Database

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.

Thanks-Allen

My Table

CREATE TABLE ***** (

***ID VARCHAR (24),

SURVEY_DATE DATE,

***ID VARCHAR (9),

**e VARCHAR (25),

**r VARCHAR (25),

***_ITEM VARCHAR (10),

SAt***TINYINT

);

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

3 REPLIES

Re: Issues with importing file with Date to Table

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.

Re: Issues with importing file with Date to Table

Hi,

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.

Cheers,

KVB
N/A

Re: Issues with importing file with Date to Table

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