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 -> Re: how to put quotes in dynamic sql?

Re: how to put quotes in dynamic sql?

From: Serge <rulsl_at_chat.ru>
Date: Tue, 23 Feb 1999 21:33:32 +0300
Message-ID: <7ausa2$kl3$1@news2.aha.ru>


I agree with previous answer but in addition, you can specify for example s := 'AAA''B''';
In the other words you should specify double quote to include quote in PL/SQL string.
If you specify s:=''''; then s will be equivalent one single quote.

ewong74_at_netscape.net wrote <7atho3$k9e$1_at_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 - 12:33:32 CST

Original text of this message

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