Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: quote in string
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C028C1.810F8110
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Thanks for your suggestions.=20
However the root of the problem is the replace(). I can get around it =
with
what you have suggested though by substr() and concatenating it back
together. =20
Thanks again
Lisa
-----Original Message-----
From: elkinsl_at_flash.net [mailto:elkinsl_at_flash.net]
Sent: Wednesday, September 27, 2000 4:32 PM
To: Multiple recipients of list ORACLE-L
Subject: Re: quote in string
Lisa,
Try coding the INSTR as:
instr(name,'''') > 0
The first quote denotes the start of the string, the second and third = quotes
gives one quote, and the fourth closes the string. Try the following 2
queries=20
to get a feel for it:
select 'O''Connor' From Dual; 2 quotes outputting one quote select '''' from dual; Now outputting just a single quote
If seeing so many tickies starts to get confusing, you can use the CHR
function=20
directly in the INSTR:
instr(name,chr(39)) > 0
Or some people like to assign CHR(39) (or '''') to a variable and refer =
to
the=20
variable throughout their code. Those are just a few of the *many* ways =
to=20
handle this. You may prefer other suggestions that are sure to appear.
Regards,
L. Elkins
On Wed Sep 27 14:36:39 2000, "Koivu, Lisa" <lkoivu_at_qode.com>,ORACLEL @fatcity.com wrote:
> Hi all -=20
>=20
> I'm putting my developer hat on again. I am writing a procedure
that=20
parses
> through a string. However, the single quote ( ' ) is becoming a =
headache.
I
> can't replace() it, I can't instr() and look for it. I am beginning =
to
think
> the only way I can get around this when I trip onto it in my code =
(and get
> it out of my string) is to fall into an exception and check character =
by
> character and recreate the string in a variable, and handle the =
exception
> caused by the single quote when it occurs, ignoring the current =
character,
> and continuing.=20
>=20
>=20
>=20> C: 954.658.5849
> V: 954.484.3191, x174
> F: 954.484.2933=20
>=20 >=20
>=20
>=20
>=20> C: 954.658.5849
> V: 954.484.3191, x174
> F: 954.484.2933=20
>=20> <HEAD>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <HTML>
>=20
>=20
>=20> </FONT>
> <P><FONT SIZE=3D2 FACE=3D"Arial">Has anyone got a better idea?=A0
>=20
>=20> <BR><FONT SIZE=3D1 FACE=3D"Arial">C: 954.658.5849</FONT>
> <P><FONT SIZE=3D1 FACE=3D"Arial">V: 954.484.3191, x174</FONT>
> <BR><FONT SIZE=3D1 FACE=3D"Arial">F: 954.484.2933 </FONT>
>=20
>=20
--=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--=20
Author:=20
INET: elkinsl_at_flash.net
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
------_=_NextPart_001_01C028C1.810F8110
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =charset=3Diso-8859-1">
<TITLE>RE: quote in string</TITLE> </HEAD> <BODY>
<P><FONT SIZE=3D2>Thanks for your suggestions. </FONT> <BR><FONT SIZE=3D2>However the root of the problem is the replace(). I = can get around it with what you have suggested though by substr() and = concatenating it back together. </FONT></P>
<P><FONT SIZE=3D2>Thanks again</FONT> <BR><FONT SIZE=3D2>Lisa</FONT> </P> <BR>
<P><FONT SIZE=3D2>-----Original Message-----</FONT> <BR><FONT SIZE=3D2>From: elkinsl_at_flash.net [<A = HREF=3D"mailto:elkinsl_at_flash.net">mailto:elkinsl_at_flash.net</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, September 27, 2000 4:32 PM</FONT> <BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT> <BR><FONT SIZE=3D2>Subject: Re: quote in string</FONT> </P> <BR>
<P><FONT SIZE=3D2>Lisa,</FONT>
</P>
<P><FONT SIZE=3D2>Try coding the INSTR as:</FONT> </P>
<P><FONT SIZE=3D2>instr(name,'''') > 0</FONT> </P>
<P><FONT SIZE=3D2>The first quote denotes the start of the string, the =
second and third quotes </FONT>
<BR><FONT SIZE=3D2>gives one quote, and the fourth closes the string. =
Try the following 2 queries </FONT>
<BR><FONT SIZE=3D2>to get a feel for it:</FONT>
</P>
<P><FONT SIZE=3D2>select 'O''Connor' From Dual; 2 quotes outputting one =
quote</FONT>
<BR><FONT SIZE=3D2>select '''' from =
dual; Now outputting just a =
single quote</FONT>
</P>
<P><FONT SIZE=3D2>If seeing so many tickies starts to get confusing, =
you can use the CHR function </FONT>
<BR><FONT SIZE=3D2>directly in the INSTR:</FONT>
</P>
<P><FONT SIZE=3D2>instr(name,chr(39)) > 0</FONT> </P>
<P><FONT SIZE=3D2>Or some people like to assign CHR(39) (or '''') to a =
variable and refer to the </FONT>
<BR><FONT SIZE=3D2>variable throughout their code. Those are just a few =
of the *many* ways to </FONT>
<BR><FONT SIZE=3D2>handle this. You may prefer other suggestions that =
are sure to appear.</FONT>
</P>
<P><FONT SIZE=3D2>Regards,</FONT>
</P>
<P><FONT SIZE=3D2>L. Elkins</FONT>
</P>
<P><FONT SIZE=3D2>On Wed Sep 27 14:36:39 2000, "Koivu, Lisa" =
<lkoivu_at_qode.com>,ORACLE-</FONT>
<BR><FONT SIZE=3D2>L_at_fatcity.com wrote:</FONT>
</P>
<P><FONT SIZE=3D2>> Hi all - </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> I'm putting my developer hat on =again. I am writing a = procedure that </FONT>
<BR><FONT SIZE=3D2>> and continuing. </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Has anyone got a better idea? </FONT> <BR><FONT SIZE=3D2>> Thanks in advance for any suggestions. </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Lisa Rutland Koivu</FONT> <BR><FONT SIZE=3D2>> Oracle Database Administrator</FONT> <BR><FONT SIZE=3D2>> Qode.com</FONT> <BR><FONT SIZE=3D2>> 4850 North State Road 7</FONT> <BR><FONT SIZE=3D2>> Suite G104</FONT> <BR><FONT SIZE=3D2>> Fort Lauderdale, FL 33319</FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> V: 954.484.3191, x174</FONT> <BR><FONT SIZE=3D2>> F: 954.484.2933 </FONT> <BR><FONT SIZE=3D2>> C: 954.658.5849</FONT> <BR><FONT SIZE=3D2>> <A HREF=3D"http://www.qode.com" =TARGET=3D"_blank">http://www.qode.com</A></FONT> <BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Hi all - </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> I'm putting my developer hat on =again. I am writing a = procedure that </FONT>
<BR><FONT SIZE=3D2>> and continuing. </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Has anyone got a better idea? </FONT> <BR><FONT SIZE=3D2>> Thanks in advance for any suggestions. </FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> Lisa Rutland Koivu</FONT> <BR><FONT SIZE=3D2>> Oracle Database Administrator</FONT> <BR><FONT SIZE=3D2>> Qode.com</FONT> <BR><FONT SIZE=3D2>> 4850 North State Road 7</FONT> <BR><FONT SIZE=3D2>> Suite G104</FONT> <BR><FONT SIZE=3D2>> Fort Lauderdale, FL 33319</FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> V: 954.484.3191, x174</FONT> <BR><FONT SIZE=3D2>> F: 954.484.2933 </FONT> <BR><FONT SIZE=3D2>> C: 954.658.5849</FONT> <BR><FONT SIZE=3D2>> <A HREF=3D"http://www.qode.com" =TARGET=3D"_blank">http://www.qode.com</A></FONT> <BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> <HTML></FONT> <BR><FONT SIZE=3D2>> <HEAD></FONT> <BR><FONT SIZE=3D2>> <META HTTP-EQUIV=3D"Content-Type" =CONTENT=3D"text/html;</FONT>
<BR><FONT SIZE=3D2>> </HEAD></FONT> <BR><FONT SIZE=3D2>> <BODY></FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> <P><FONT SIZE=3D2 =FACE=3D"Arial">Hi all - </FONT></FONT>
<BR><FONT SIZE=3D2>> </P></FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> <P><FONT SIZE=3D2 =FACE=3D"Arial">I'm putting my developer hat on</FONT> <BR><FONT SIZE=3D2>> again.=A0 I am writing a procedure that parses = through a string.=A0 However, the</FONT> <BR><FONT SIZE=3D2>> single quote ( ' ) is becoming a headache. I = can't replace() it, I can't instr</FONT> <BR><FONT SIZE=3D2>() and look</FONT>
<BR><FONT SIZE=3D2>> </FONT></P></FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> <P><FONT SIZE=3D2 = FACE=3D"Arial">Has anyone got a better idea?=A0</FONT> <BR><FONT SIZE=3D2>> </FONT></FONT><BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D2 = FACE=3D"Arial">Thanks in advance for any</FONT>
<BR><FONT SIZE=3D2>> suggestions. </FONT></FONT> <BR><FONT SIZE=3D2>> </P></FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> <P><B><FONT SIZE=3D1 =FACE=3D"Arial">Lisa Rutland</FONT> <BR><FONT SIZE=3D2>> Koivu</FONT></B></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">Oracle Database</FONT> <BR><FONT SIZE=3D2>> Administrator</FONT></FONT>
<BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">Qode.com</FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">4850 North State Road 7</FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">Suite G104</FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">Fort Lauderdale, FL=A0</FONT> <BR><FONT SIZE=3D2>> 33319</FONT></FONT> <BR><FONT SIZE=3D2>> </P></FONT><BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> <P><FONT SIZE=3D1 = FACE=3D"Arial">V: 954.484.3191, x174</FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">F: 954.484.2933 </FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial">C: 954.658.5849</FONT></FONT> <BR><FONT SIZE=3D2>> <BR><FONT SIZE=3D1 = FACE=3D"Arial"><A</FONT><BR><FONT SIZE=3D2>> HREF=3D"<A HREF=3D"http://www.qode.com" = TARGET=3D"_blank">http://www.qode.com</A>"</FONT> <BR><FONT SIZE=3D2>> TARGET=3D"_blank"><A = HREF=3D"http://www.qode.com" =
<BR><FONT SIZE=3D2>> </P></FONT> <BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> <P><I><FONT =COLOR=3D"#000000" SIZE=3D1</FONT> <BR><FONT SIZE=3D2>> FACE=3D"Arial">"The = information contained herein does not express the</FONT> <BR><FONT SIZE=3D2>> opinion or position of Qode.com and cannot be = attributed to or made binding </FONT>
<BR><FONT SIZE=3D2>> </FONT> <BR><FONT SIZE=3D2>> </BODY></FONT> <BR><FONT SIZE=3D2>> </HTML></FONT> </P>
<P><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" =
TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT> <BR><FONT SIZE=3D2>Author: </FONT> <BR><FONT SIZE=3D2> INET: elkinsl_at_flash.net</FONT> </P>
<P><FONT SIZE=3D2>Fat City Network Services -- (858) =
538-5051 FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California -- Public Internet =
access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=-----</FONT>