Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic SQL
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
![]() |
![]() |