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

Home -> Community -> Usenet -> c.d.o.misc -> Re: ' in dynamic sql

Re: ' in dynamic sql

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 6 Dec 2001 08:50:15 -0800
Message-ID: <9uo7k7018db@drn.newsguy.com>


In article <3c0f16aa_at_cpns1.saic.com>, "Allan says...
>
>Hi,
>
>I have got a dynamic SQL statement which when build, the data which is going
>to be inserted into a table, may have the ' symbol in it. This means that
>when I'm executing my SQL statement, the string is ended by the rouge ' .
>Can anyone suggest anything?
>
>Allan
>
>

USE BIND VARIABLES!!! not only will the occurrence of a ' in the string no longer be relevant, its the only way your application will

o scale
o make use of shared sql
o perform with a darn
o work

   insert into t values ( :b1, :b2 );

and BIND the values for b1 and b2. Every language can do this.

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Thu Dec 06 2001 - 10:50:15 CST

Original text of this message

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