Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Help
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.comReceived on Sat Aug 02 1997 - 00:00:00 CDT
![]() |
![]() |