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: how to store as a varchar2 a string containing single quotes

Re: how to store as a varchar2 a string containing single quotes

From: mark <mark_brehmen_at_yahoo.com>
Date: 12 Sep 2001 22:10:49 -0700
Message-ID: <fa4781e4.0109122110.140d03c3@posting.google.com>


I might be wrong, but why dont you assign it to a bind variable first  

:1 = decode( handled_status, 'F', 0, 'U', 1, 'S', 2, 3 )

insert into table (:1)

regards
Mark

postbus_at_sybrandb.demon.nl (Sybrand Bakker) wrote in message news:<a20d28ee.0109120048.28741e77_at_posting.google.com>...
> dmscott_at_flash.net (DMScott) wrote in message news:<3b9eb2ea.14954769_at_news.prodigy.net>...
> > I am very interested to store in a database the following kind of
> > string data, which correctly resembles part of an SQL command:
> >
> > decode( handled_status, 'F', 0, 'U', 1, 'S', 2, 3 )
> >
> > 1. I am trying to avoid storing the chr( ) function as part of the
> > string data
> > 2. I am reluctant to do any auxiliary conversions on the string that
> > would require conversion back to this before use
> >
> > The string would be stored in a regular Oracle table as varchar2.
> >
> > Help! I'm really out of ideas, and if I can't do this without going
> > against #1 or #2 (or both), then say so! But I need something here!
>
> Apart from trying to escape the ' by using '' for one ', there is no
> other solution than to go with #1
>
> Hth,
>
> Sybrand Bakker, Senior Oracle DBA
Received on Thu Sep 13 2001 - 00:10:49 CDT

Original text of this message

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