Oracle-统计数据库表数据总数量
时间:2021-07-01 10:21:17
帮助过:252人阅读
or replace procedure prc_table_count(p_flag out
varchar2)
AS
TCOUNT number;
SCOUNT number;
COUNTSQL VARCHAR2(
500);
BEGIN
TCOUNT:= 0;
SCOUNT:= 0;
FOR c_row
IN (
select table_name
from SYS.USER_TAB_COMMENTS t
WHERE T.table_name
LIKE ‘ZZJG%‘
) LOOP
COUNTSQL:=‘select count(1) from ‘||C_ROW.table_name;
DBMS_OUTPUT.put_line(COUNTSQL);
execute immediate COUNTSQL
into TCOUNT;
SCOUNT:=SCOUNT
+TCOUNT;
END LOOP;
DBMS_OUTPUT.put_line(SCOUNT);
p_flag := ‘1‘;
END prc_table_count;
Oracle-统计数据库表数据总数量
标签:count sql table blog lag iat tco body user