execute immediate quote escape oracle pl/sql

To run this via execute immediate:

CREATE TABLE t2 AS SELECT * FROM t1 WHERE col1 = '1' ;

Either use new style quote format:

EXECUTE IMMEDIATE q'[CREATE TABLE t2 AS SELECT * FROM t1 WHERE col1 = '1']' ;

Or older style still works also:

EXECUTE IMMEDIATE 'CREATE TABLE t2 AS SELECT * FROM t1 WHERE col1 = ''1''' ;
Posted in Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *

*