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: Dynamic SQL

Re: Dynamic SQL

From: hackman <m_at_m.com>
Date: Thu, 10 Feb 2000 02:57:13 GMT
Message-ID: <dOpo4.12414$Mk2.498347@newsread2.prod.itd.earthlink.net>


whenever you have a single quote within your sql command you have to escape it with another ' for instance -
select 'select * from '||table_name|| ' where sample_column = ''foo'' (<= those are two single quotes not double qoutes) from user_tables where table_name like '%BLAH';

My Name <gxck_at_mindspring.com> wrote in message news:38A21B7D.C4C673E6_at_mindspring.com...
> Hello all:
> I am having problem with this dynamic sql because of the single quote
> around foo. Is there a way around it?
>
> select 'select * from '||table_name|| ' where sample_column = 'foo''
> from user_tables where table_name like '%BLAH';
>
>
Received on Wed Feb 09 2000 - 20:57:13 CST

Original text of this message

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