Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SELECT order
<david.largeteau_at_sage.com> ¼¶¼g©ó¶l¥ó news:9de8hl$ca5$1_at_news.netmar.com...
> Hi,
> How can i use variable table name in the FROM clause of a select statement ?
> In a PL/SQL bloc :
> ..
> Begin
> ..
> SELECT COUNT (*)
> INTO w_count
> FROM name_of_table
> WHERE cod_clt = enr_orig.cod_clt;
> ..
> End;
On Oracle8i, you can use:
begin
...
execute immediate 'select count(*) from '||name_of_table||
' where cod_clt=enr_orig.cod_clt' into w_count;
...
end;
Received on Fri May 11 2001 - 15:13:59 CDT