Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to insert quote in a column

Re: how to insert quote in a column

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Mon, 18 Jun 2001 16:32:49 -0700
Message-ID: <F001.0032DF4C.20010618164046@fatcity.com>

Hello Harvinder,

If you are doing the insert from SQL*Plus, double up on the quote. For example:

insert into your table (name) values ('''joy''');

The resulting value will be (quotes included):

    'joy'

BTW, this came in handy recently when I went to a web site
(I won't say whose) and tried to search for a term with an
apostrophe in it. The search kept failing with some sort of string error, so it eventually occurred to me to use a double-apostrophe where I wanted one. The search then worked. Obviously some programmer didn't take the possibility of a user entering an apostrophe into account when he concatenated everything together to build his SQL statement.

Best regards,

Jonathan Gennick
mailto:jonathan_at_gennick.com * 906.387.1698 http://Gennick.com * http://MichiganWaterfalls.com * http://MetalDrums.org

Monday, June 18, 2001, 7:25:21 PM, you wrote:

HS> I have a column defined as varchar2......i need to insert name like 'joy' in
HS> it with quote....
HS> how can we insert quote(') to column.


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jonathan Gennick
  INET: jonathan_at_gennick.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Mon Jun 18 2001 - 18:32:49 CDT

Original text of this message

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