Subject: Re: How to use " in Oracle data
<4islge$> (Gerard H. Pille) writes:

>In article , 
>blained ( says...
>!>This is being relayed for a co-worker:
>!>We are encountering db values that contain both double quotes and 
>!>apostrophes.  Has anyone found a work-around for this situation?
>But what is the problem?

>Kind reGards
>     \ /   |
>      X    |
>     / \   s
>     Gerard

Gerard was correct in that you didn't fully describe your problem. However,
if you want to deal with single quotes for values in your SQL statements, 
you need to prepend another single quote. For example,
Insert a record with a single quote at the beginning:

insert into TAB_NAME values
('''This is a test!');

See if this was inserted correctly:

select * from TAB_NAME;

'This is a test!

1 row selected.
If you want to search for a single or double quote within a string, use the
INSTR function. If there is no quote, then a 0 is returned. Otherwise, 
the position of the quote is returned. See your SQL Language Reference 
Manual for more details on this.
You can also use the TRANSLATE function to make all single quotes double 
quotes, or vice versa. This will change any occurence of a character to 
whatever new character you choose within a string.

I hope this helps! Your question was ambiguous, so let us know if you 
need more information. Good luck.

-Ari Kaplan
Independet Oracle DBA Consultant

<-> Visit my Web Page:                          <->
<->             email:                    <->

Back to Ari Kaplan's Home Page ht="18">Back to Ari Kaplan's Home Page