I've met the problem when using execute immediate in Teradata.
SET str_sql = 'UPDATE TABLE
SET COLA = 0';
EXECUTE IMMEDIATE str_sql;
The above code works fine.
SET str_sql = 'UPDATE TABLE
SET COLA = 0,
COLB = ''test''';
EXECUTE IMMEDIATE str_sql;
The above code with string returns error.
The following is the error message:
Executed as Single statement. Failed [3706 : 42000] Table:Syntax error: expected something between a string or a Unicode character literal and the word 'test'.
Elapsed time = 00:00:00.212
STATEMENT 1: CALL failed.
Anyone know how to invoke the execute immediate with String in the sql? Thanks!
Frank Liu