Hi all.
I'm trying to run the following statement in my PL/SQL block using EXECUTE IMMEDIATE:
V_SQL_STMT := 'UPDATE TABLE_NAME SET '||L_V_COL||' = '||L_AMOUNT||'WHERE ID = '||L_ID||'';
EXECUTE IMMEDIATE V_SQL_STMT;
All of the above variables are taken from a cursor which takes them from a different table to the one being updated. The above works perfectly, with one exception.
One of the columns (saved in L_V_COL) is called 6UY. As this column starts with a number when this table was created it had to be created within quotation marks ("").
When the above runs and it comes across an update to this column, it does not update as it must think the column is invalid (as it does when trying to create it without the quotation marks.
How can I modify V_SQL_STMT so that it will update this column as well as all the other valid columns?
I'm assuming it's by using a break character in order to allow me to put a quotation mark in the statement, but I don't know what this is for Oracle SQL. Is this right anyway?
Thanks,
fakelvis