028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

Oracle统计某个用户下所有表的各自行数

set serveroutput on 


declare
  t_count   number(10);
  t_str VARCHAR2(500);
  cursor t_tables is select table_name from user_tables;
begin
  for t_row in t_tables loop
    t_str := 'select count(*) from '|| t_row.table_name;
    execute immediate t_str into t_count;
    dbms_output.put_line( t_row.table_name || '=' || to_char(t_count));
  end loop;
end;

当前名称:Oracle统计某个用户下所有表的各自行数
转载来源:http://www.tsicrk.com/article/ghgdpc.html

其他资讯

让你的专属顾问为你服务

2.8751s