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: pl/sql and hochkommas

Re: pl/sql and hochkommas

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Sun, 7 Dec 2003 20:55:21 -0500
Message-ID: <p_adndo2leqpR06i4p2dnA@comcast.com>

"Ana C. Dent" <anacedent_at_hotmail.com> wrote in message news:MTNAb.70017$kl6.60060_at_fed1read03...
| Hubert Holler wrote:
| > I want to use a hochkomma in a select (insert) like:
| > select count(*) into v_vorhanden from wort_suche where wort_id =
v_id_wort
| > and buchstabe = upper( || "'" || buchstabe || "'" || ) and benutzer_id =
| > login.getid_benutzer;
| >
| > Hope there can somebody help me.
| > Thanks a lot.
| > Hubert
|
| I'm not 100% sure I understand what you are asking.
| You might want to use the CHR() function in place of single or double
| quote marks.

since the hochkomma (literally 'high comma', or commonly 'single quote') is a standard delimiter for character strings, it must be doubled when included within a charcater string literal, i.e.

'this is the way it''s done'

note that it''s is 5 characters: i t ' ' s

so, a quoted literal which consists of only the hochkomma would be 4 hochkomma characters -- one to delimit the literal string, one to escape the literal character, one for the literal character, then one last one to delimiter the literal string:

select count(*)
into v_vorhanden
from wort_suche
where wort_id = v_id_wort
and buchstabe = upper( '''' || buchstabe || '''' ) and benutzer_id = login.getid_benutzer;

however, it look like you WHERE clause logic might be faulty, since the expression

    buchstabe = upper( '''' || buchstabe || '''' )

can never by true (a column value will never be equal to itself with additional characters concatenated)

PS: handy site to check out: www.freetranslations.com Received on Sun Dec 07 2003 - 19:55:21 CST

Original text of this message

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