hi,你好!欢迎访问本站!登录
站点地图 文章归档 免责声明 投稿本站 RSS订阅
当前位置:首页 - 笔记 - 数据库 - 正文 个人博客网站开通,欢迎!!!

Oracle count方式统计表数据量

2017-08-15数据库站长9696°c
A+ A-
select a.table_name,comments, xw_count_rows(a.table_name) nrows , '/*'||b.comments||'*/    '|| 'truncate table ' || a.table_name || ';'  as sql_text
from user_tables a,all_tab_comments b where a.table_name = b.table_name and a.table_name like 'T%' and xw_count_rows(a.table_name) > 0
order by xw_count_rows(a.table_name) desc;


/* ----函数传入表名,获取表count
create or replace function xw_count_rows(table_name in varchar2,
                                      owner      in varchar2 default null)
  return number authid current_user IS
  num_rows number;
  stmt     varchar2(2000);
begin
  if owner is null then
    stmt := 'select count(*) from "' || table_name || '"';
  else
    stmt := 'select count(*) from "' || owner || '"."' || table_name || '"';
  end if;
  execute immediate stmt
    into num_rows;
  return num_rows;
end;
*/


  选择打赏方式
微信赞助

打赏

QQ钱包

打赏

支付宝赞助

打赏

  选择分享方式
  移步手机端
Oracle count方式统计表数据量

1、打开你手机的二维码扫描APP
2、扫描左则的二维码
3、点击扫描获得的网址
4、可以在手机端阅读此文章
标签:

发表评论