| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL SQL <table_name> , count(*)
Basically the same thing that others have proposed, does the count(*) rather
than doing an analyze.
Declare
Column1 varchar2(50);
Column2 Integer;
sqltext varchar2(500);
c_handle Integer;
bogus Integer;
Cursor MyTables is
select table_name
from user_tables
order by 1;
Begin
-- Construct the sql statement. Notice the use of double-single quotes to get
dbms_sql.parse(c_handle, sqltext, DBMS_SQL.NATIVE);
-- This binds the return columns. Is is required for select statements.
dbms_sql.define_column(c_handle, 1, Column1, 50);
dbms_sql.define_column(c_handle, 2, Column2);
-- Actually execute the statement, required for select and dml statements
bogus := dbms_sql.execute(c_handle);
LOOP
begin
-- The loop could be written differently.. this next statement fetches the next
Matt Gross wrote:
> I would like to create a pl/sql script which gives me a list of all tables > and then gives me a count of all rows for each table. Does anyone know how > to do this? > > Thanks, > > MattReceived on Tue Dec 18 2001 - 11:08:56 CST
![]() |
![]() |