Re: Dynamic SQL

From: DanHW <danhw_at_aol.com>
Date: 10 Feb 2000 02:42:23 GMT
Message-ID: <20000209214223.01359.00000185_at_ng-fz1.aol.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';
>
Enclose the quoted portion in 2 single quotes...

select 'select * from '||table_name|| ' where sample_column = ''foo'' from user_tables where table_name like ''%BLAH'';

  • Note these are NOT " (quotes) but 2 of these ' (apostropheses)

Dan Hekimian-Williams Received on Thu Feb 10 2000 - 03:42:23 CET

Original text of this message