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

how to store as a varchar2 a string containing single quotes

From: Kock, Gerd <GKock_at_pdv-Online.de>
Date: Wed, 12 Sep 2001 08:08:12 +0200
Message-ID: <90333AAED533D411950600104B45E019036C9462@pdv-exchng.pdv-online.de>

  1. you may use a bind variable and put the string containing single quotes in there
  2. you may use another single quote to masquerade the single quote insert into <table> (col_varchar2) values ('''F'''); in this example, the first single quote marks the beginning of the string the second one prevents the third one from ending the string but instead being included in the string and so on

Hope that helps

Gerd Kock
-----Ursprüngliche Nachricht-----
Von: dmscott_at_flash.net (DMScott) [mailto:dmscott_at_flash.net] Bereitgestellt: Mittwoch, 12. September 2001 03:09 Bereitgestellt in: server
Unterhaltung: how to store as a varchar2 a string containing single quotes
Betreff: how to store as a varchar2 a string containing single quotes

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! Received on Wed Sep 12 2001 - 01:08:12 CDT

Original text of this message

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