Update Query Failing

UDA
Enthusiast

Update Query Failing

I have the following update query which fails as below

UPDATE TARGET_TABLE SET TARGET_TABLE.COL_VARCHAR = 'a';

*** Failure 3706 Syntax error: expected something between the word 'TARGET_TABLE' and '.'

Any thoughts why ?
3 REPLIES
Enthusiast

Re: Update Query Failing

Hi,
you might have set the default database.
so remove TARGET_TABLE.COL_VARCHAR use only COL_VARCHAR.
The syntax is
UPDATE TARGET_TABLE SET COL_VARCHAR = 'a';
Enthusiast

Re: Update Query Failing

Why will the default database affect this ? Will removing the default database allow me to use the query with no changes ?

Also, this query is being formed by an application (application generates the sql and fires it on the underlying database) and is working for Oracle/Sybase etc; The failure is only on Teradata;
Enthusiast

Re: Update Query Failing

You can use the query without setting the deafault database as:

UPDATE database_name.TARGET_TABLE SET COL_VARCHAR = 'a';
This will work.

You can not use TARGET_TABLE.COL_VARCHAR = 'a' in set statement like oracle/sybase.

Regds,
Sachin