BTEQ import problem
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


BTEQ import problem Expand / Collapse
Author
Message
Posted 6/13/2008 5:40:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/24/2008 11:42:56 AM
Posts: 2, Visits: 8
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:
28304;2007-03-31;2008-01-15
80676;2007-12-31;2008-02-01

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 *

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

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

.logoff;
.quit;
Post #11861
Posted 6/13/2008 5:53:26 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 5:35:53 PM
Posts: 439, Visits: 421
The casting syntax is not correct, actually you don't need to cast ....

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

insert into storedt values
(:Outlet_ID
,:Opened
,:Upgraded
);
Post #11862
Posted 6/13/2008 6:08:18 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/24/2008 11:42:56 AM
Posts: 2, Visits: 8
Seems easy enough now! Thanks!

Post #11864
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 10:23pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 7 queries. Compression Disabled.