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: simple PL/SQL syntax question.

Re: simple PL/SQL syntax question.

From: Robert Edgar <robedgar_at_hkstar.com>
Date: 1997/12/25
Message-ID: <67v3vg$5hh1@news.hk.linkage.net>#1/1

Makes perfect sense to me.......
To embed a single quote in a string you usually need to double it. If you remove the text from your string its a bit clearer

' '''|| || ''''

so youve got 4 ticks and 4 ticks , both parts are a sinlge tick to start a string a single tick to end the string and in the middle two ticks to indicate an embeded single tick.

Rob

Rich Davies wrote in message
<01bd0f02$0030eec0$af01010a_at_msppc060.retek.com>...
>Can someone explain why this works, please?
>
>I want to set the value of one local string variable in PL/SQl to:
>
> USER_ID = 'another_local_string'
>
>including the single ticks. Through trial and error I've found the
>following assignment statement works.
>
>a_local_string := 'USER_ID = ''' || another_local_string || '''' ;
>
>In case this is hard to read with your typeface, that is: one single tick
>at the beginning, three single ticks in the middle, and four single ticks
>at the end.
>
>Does this make sense to anyone? If so please enlighten me. Thanks in
>advance.
>--
>richard_davies_at_retek.com
Received on Thu Dec 25 1997 - 00:00:00 CST

Original text of this message

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