All Forums Tools
kumquatz 1 post Joined 02/13
20 Feb 2013
Importing Data from file with sql assistant

Hi, I
have created a table:

create table sandbox.xyz
(name varchar(256) not null);

and want to load data from a file with the following command:

insert into sandbox.xyz
(?);

the file I use contains just one value 'test'
after I have executed the query and choosen a file the following errormessage appears:
ERROR [42000] [Teradata][ODBC Teradata Driver][Teradata Database] Syntax error, expected something like ';' between the word 'xyz' and the 'INSERT' keyword. 
Unexpected Error. Refer to the following file for details:
C:\Users\PSteinnoekel\AppData\Roaming\Teradata\SQL Assistant\SQLAError.Txt
 
The textfile contains the following:
 

20.02.2013 12:28:17

SQLA Version: 14.1.0.2

Driver Version: ODBC 14.00.00.04

System.Data.Odbc.OdbcException: ERROR [42000] [Teradata][ODBC Teradata Driver][Teradata Database] Syntax error, expected something like ';' between the word 'xyz' and the 'INSERT' keyword. 

   bei System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)

   bei System.Data.Odbc.OdbcCommand.Prepare()

   bei Teradata.SQLA.RunQry.DoImportBind() in V:\cm.client.ttu1401.efix\tdcli\qman\sqla\RunQry.vb: Zeile 1821.

 

Can someone help me? Thanks!

dnoeth 4628 posts Joined 11/04
21 Feb 2013

I just tried it, seems to be a bug in SQLA while parsing the highlighted text.
Is this your code?

create table sandbox.xyz
(name varchar(256) not null)

insert into sandbox.xyz
(?);

Add a  semicolon after the end of the previous query before the insert.
Dieter

Dieter

MBSconnection 29 posts Joined 07/13
22 Aug 2013

I'm using SQLA 13.11.0.03
August 12, 2011
ODBC 13.10.00.06
Database Version Teradata 13.10.0511 13.10.05.11
I have coma delimited CSV with No headers.
When I try to import it in a Table that has a Structure

Col1 CHAR(2) NOT NULL  default 'NA',
Col2 CHAR(2)  NOT NULL  default 'US',     
Col3 CHAR(2) NOT NULL  default 'GHH',       
Col4 CHAR(16) NOT NULL  default 'Opt - ins (1,CT)',
Col5 CHAR(6)NOT NULL default '(1,CT)',
Col6 CHAR(5) NOT NULL default 'Daily',
Col7 CHAR(6)NOT NULL default 'GHH-US',   
MyDate DATE  NOT NULL FORMAT 'YYYY-MM-DD',
Q1Count Integer  null,
Q2Count Integer null,
Q3Count Integer null,
Q4Count Integer null,
Q5Count Integer null,
Q6Count Integer null,
Q7Count Integer null)
PRIMARY INDEX MyDate (MyDate );

insert into TWM_SANDBOX.T1
Values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);
 
Error:
Query contains 15 parameters but import file contains 21 data values
tools->options->export/import/->import also set to comma delimited
Click on File and Select Import Data,Now writeinsert into table.namevalues(?, ?, ?, ?) no of columns on the table should be equal to ?now press f5, it will ask for the source, jus browse and select the source and you can load the data in to the table using SQL assistant.
 
Not working??
Any clue??
 

You must sign in to leave a comment.