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: PL/SQL Help

Re: PL/SQL Help

From: Leslie_B_DreyerKalra <lbd_at_techiesinc.com>
Date: 1997/08/02
Message-ID: <33E3BDA7.759A@techiesinc.com>#1/1

Cecil wrote:
>
> Tomm Carr wrote in article <33E1275F.5D59_at_geocities.com>...
>
> LOWER(KEYWORDS.KEYWRDS) = LOWER(''' || keywd1 ||''' )' ||
>
> Tom,
> Could you please explain to me the quotes you have placed. I somehow can't
> understand how 7 single quotes are needed.

This SQL statement needs to have single-quotes around the value of keywd1. The only way to actually get a single quote to appear in the SQL string is to put it itself in single quotes, which gives you three quotes in a row. Kind of like escaping special characters in Unix shell or perl.

I beat my head against the wall on this for a while myself -- if you don't put those single-quotes in there, it interprets the value of keywd1 as a column in the table and you get 'invalid column name' errors. Putting all those single-quotes makes it interpret it correctly as a string...

The seventh single quote actually closes the entire dynamic SQL string...

Hoping I've made some modicum of sense...

-- 
Leslie Dreyer Kalra
Techies, Inc.
lbd_at_techiesinc.com
Received on Sat Aug 02 1997 - 00:00:00 CDT

Original text of this message

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