新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

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统计某个用户下所有表的各自行数
URL分享:http://www.wjwzjz.com/article/ghgdpc.html
在线咨询
服务热线
服务热线:028-86922220
TOP