Re: Apostrophe in SQL*Plus string

From: Jonathan Gennick <gennick_at_worldnet.att.net>
Date: 1997/10/18
Message-ID: <344b241a.3556874_at_netnews.worldnet.att.net>#1/1


On Fri, 17 Oct 1997 16:21:43 GMT, alans_at_array.ca (Alan Screen) wrote:

>I'm trying to use an apostrophe as part of the search condition
>in a select statement - e.g.,
>
> In the description field of a record I have the following string:
>
> Alan's sample description
>
> and I'm trying to do a query like
>
> SELECT name FROM mission WHERE description LIKE <desc_clause>
>
>However, I'm can't seem to find the syntax for <desc_clause> which
>would allow me to search for "Alan's%", because there is an apostrophe
>in the string - i.e.,

Double-up on the apostrophes. For example:

SQL> select * from test1;

A_COLUMN



Jonathan's
Alan's

SQL> select * from test1 where a_column like 'Alan''s%';

A_COLUMN



Alan's

regards,

Jonathan Gennick



gennick_at_worldnet.att.net
http://home.att.net/~gennick Received on Sat Oct 18 1997 - 00:00:00 CEST

Original text of this message