BTEQ import problem

Tools & Utilities

BTEQ import problem

I'm trying to create a simple table from external data that has problems with dates. The original data resides in MS Access, but I am exporting dates in a 10-char field as below.
I get: Failure 3707 Syntax error, expected something like ')' or ',' between the word 'Opened' and the 'cast' keyword.
What am I missing?
Should I be performing the cast in the using statement or the insert?
What is the corrcet syntax?
Very confused!!

Data format:

BTEQ script:
database dbname;
drop table dbname.storedt ;
create table dbname.storedt (
Outlet_ID varchar(10)
,Opened date
,Upgraded date
unique primary index (Outlet_ID);

.quiet on
.import vartext ';' file = filename.txt;
.repeat *

Outlet_ID (varchar(10))
,Opened (date)
,Upgraded (date)

insert into dbname.storedt values
,:Opened (cast(Opened as date)
,:Upgraded (cast(Upgraded as date)


Re: BTEQ import problem

The casting syntax is not correct, actually you don't need to cast ....

Outlet_ID (varchar(10))
,Opened (varchar(10))
,Upgraded (varchar(10))

insert into storedt values

Re: BTEQ import problem

Seems easy enough now! Thanks!