Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

Database

Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

Hi guys!

I'm facing this problem(I've programmed it in C#/.NET):

Performing this part of code:

adaptador.InsertCommand = command;

command.UpdatedRowSource = UpdateRowSource.None;

adaptador.UpdateBatchSize = 100;

command.CommandText = "INSERT INTO TABLE1 (FIELD1, FIELD2, FIELD3) VALUES(?,?,?);";

adapter.Update(myDataTable);


I've got this error:

[Teradata Database] [3704] '' ('0A'X) is not a valid Teradata SQL token. em System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)

em System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)

em System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)

em System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)

em System.Data.Common.DbDataAdapter.Update(DataTable dataTable)

na F:\Application\File.cs:linha 100


My DataTable(myDataTAble) has 3 columns with same name of the 3 field of the table and it's already populated.

What problem could be?

Thanks for help,

Anderson
10 REPLIES
N/A

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

hi there.

am learning teradata sql (sql ingeneral) and i got this error:

SELECT Failed. [3704] '' ('60'X) is not a valid Teradata SQL token.

the script was running well until i defined the column aliases for e.g:

, PS5IE.S5IE_ADJ_TOT_AMT ptnr_adj_amt

N/A

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

Hi Amadu,

'60'x should be a backtick "`", this is not valid in Teradata (or Standard SQL).

You don't need to quote a name unless there are invalid characters in it or it's a reserved name.

And then use double quotes instead:

PS5IE.S5IE_ADJ_TOT_AMT AS "ptnr_adj_amt"

Did you work with MySQL before? :-)

N/A

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

thanks Dieter.

sorry i was away on leave just got back this morning!

yes it was a back tick. alls good now.

Unfortunately teradata sql is my first and its getting me excited!

my current task is building volatile tables as part of my data analysis.

I've heard so much about volatile tables and to be creating one... :)

N/A

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

 How to rollup totals from different columns and insert into one column

Hi there,

I have created a column to hold the total amounts for all amounts types recorded against an event.

the insert statements worked well for all the columns.

what i want to do is to rollup the total amounts for the 9 columns below and insert into the new column (CUST_TOTAL_AMT).

 ,S5IE_ADJ_TOT_AMT                      INTEGER

 ,S5IE_DEDN_MAINT_EXPEND_AMT  INTEGER

 ,S5IE_FGN_INC_AMT                      INTEGER

 ,S5IE_FRNG_BEN_AMT                    INTEGER

 ,S5IE_NET_INV_LOSS_AMT             INTEGER

 ,S5IE_RPT_SUPER_CONTRIB_AMT    INTEGER 

 ,S5IE_TAX_FREE_PENR_BEN_AMT    INTEGER 

 ,S5IE_TAXEXE_FGN_INC_AMT          INTEGER

 ,S5IE_6MTH_INC_AMT                     INTEGER 

 , CUST_TOTAL_AMT                         INTEGER  

Below is sample of the insert statement that works well for the 9 columns above?

  , ...

  , CAST(S5IE.S5IE_ADJ_TOT_AMT AS DECIMAL(15,2))/100 AS ADJ_TOT_AMT

  , etc

  , etc

Best Regards  

 

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

Hi everybody,

after upgrading tdodbc driver from 15.00 to 15.10 i've faced with the similar error message:

3704 - ' ' ('0A'X) is not a valid Teradata SQL token

when try to create the simplest table via odbc:

create table product ( prod_id integer not null with default,

    prod_price decimal(10,2) not null with default,

    prod_descrip varchar(20) not null with default )

however, table was created if remove '\n':

create table product (     prod_id integer not null with default,     prod_price decimal(10,2) not null with default,     prod_descrip varchar(20) not null with default )

Also statement with carriage returns works correctly if use tdodbc-15.00

Is any way to process sql statements with '\n' ?

Environment:

tdodbc-15.10.00.01-1

Linux 2.6.32-431.el6.x86_64

Thanks in advance

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

@oleksandr.savin

Do you have an update as to how you resolve this? I am using MS Access odbc and it has the same issue on LOJ adding a line feed automatically that Teradata does not recognise.  Thanks in advance

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

@jobbazar

I did not find any solution, i've reverted back to 15.00 odbc driver,

BTW,

This is only linux specific problem,

Windows driver can process newlines

N/A

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

Is this behaviour of the 15.10 ODBC driver a known bug? 

Re: Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token.

I faced the same issue with ODBC 15.10 and it would be nice if there is any information about it.

Regards, Kristiyan