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 -> PL/SQL Problem

PL/SQL Problem

From: VampireD <vampired_at_my-deja.com>
Date: Fri, 20 Oct 2000 16:22:45 GMT
Message-ID: <8sprgb$bgn$1@nnrp1.deja.com>

DECLARE CURSOR get_table_sizes_cur
IS
SELECT table_name
  FROM dba_tables
 WHERE table_name = 'TRADE_HISTORY';

row_count NUMBER;
tab_name get_table_sizes_cur%ROWTYPE;

BEGIN FOR tab_name IN get_table_sizes_cur
LOOP
SELECT count(*)
  INTO row_count
  FROM tab_name;
dbms_output.put_line(row_count);

EXIT WHEN get_table_sizes_cur%NOTFOUND;
END LOOP; END;
/

How would I get the SELECT to read from tab_name rather than from a particular table?

--
Christopher R. Spence
OCP, MCP, MCSE, A+, RAPTOR, CNA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Oct 20 2000 - 11:22:45 CDT

Original text of this message

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