Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SELECT order

Re: SELECT order

From: fumi <fumi_at_tpts5.seed.net.tw>
Date: Sat, 12 May 2001 04:13:59 +0800
Message-ID: <9dp12v$1h0$3@news.seed.net.tw>

<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

Original text of this message

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