Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> how to put quotes in dynamic sql?

how to put quotes in dynamic sql?

From: <ewong74_at_netscape.net>
Date: Tue, 23 Feb 1999 06:27:22 GMT
Message-ID: <7atho3$k9e$1@nnrp1.dejanews.com>


I have a pl/sql block that pass a DDL as a string into an other procedure to execute the DDL statements using dynamic sql. The dynamic sql procedure is called 'exec':
exec('DROP TABLE table_name');

I got a problem when I come across a DDL which has a string in the where clause. The multiple quotes generate an error: exec('CREATE TABLE table_name as SELECT * from other_table where field_name 'hello''); ^^

Any ideas?
Thanx in advance!

Ed

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Feb 23 1999 - 00:27:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US