EXECUTE IMMEDIATE 'UPDATE GDW_ARC_CDM.LND_DIM_GEO
SET DESCRIPTION_COLUMN = REPLACE( DESCRIPTION_COLUMN, '`', '''' )
WHERE CNTRY_ID = 'KR'
AND SRC_ID = 'KR_RET'
AND DESCRIPTION_COLUMN LIKE '%`%'';
COMMIT;
I'm trying to add the above statement in Oracle SP, I m getting below error, the same query works in SQL Developer as a normal statement (not in SP).
Could you please suggest?
Problem is in a fact that you have to enclose that
UPDATEinto single quotes (what you did), but taking care about other single quotes within that code. All of them have to be "doubled", or - a simpler and easier to read & maintain option - use the q-quoting mechanism.Something like this: