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

Home -> Community -> Usenet -> c.d.o.misc -> [PL/SQL] Help - Select into from a variable tablename?

[PL/SQL] Help - Select into from a variable tablename?

From: David & Janet Harris <music_at_waymark.com>
Date: 1997/04/19
Message-ID: <5j97k7$1pn@news1-alterdial.uu.net>#1/1

I need some help selecting into from a variable tablename. Example:

    Procedure CountTable(tbl char) is
      cnt number;
    BEGIN

      select count(*) into cnt from tbl;
      dbms_output.put_line (tbl || '  ' || cnt);
    end;

PL/SQL interprets tbl as an existing table and fails. I would like to have a loop call this routine for each table in a user's schema yielding these results:

Tablename       Cnt
---------       ---
TABLE1          234
TABLE2          823

.
.
.

Any ideas? Thanks in advance.

--David H. Received on Sat Apr 19 1997 - 00:00:00 CDT

Original text of this message

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