其他分享
首页 > 其他分享> > 查询某个用户下各个表的数据量

查询某个用户下各个表的数据量

作者:互联网

CREATE OR REPLACE FUNCTION sql_excute(v_sql IN VARCHAR2)
  RETURN VARCHAR2 IS
  v_result VARCHAR2(1000);
BEGIN
  IF v_sql IS NULL THEN
    RETURN '';
  ELSE
     begin
    execute immediate v_sql into v_result;
    exception
      when others then
      v_result :='0';
      end;

  END IF;

  RETURN(v_result);

END sql_excute
   select  TABLE_NAME , sql_excute('select count(*) from ' || t.TABLE_NAME) as count
 from dba_tables t where t.OWNER='CREDITFW' 

标签:excute,RETURN,查询,VARCHAR2,result,数据量,sql,某个,select
来源: https://www.cnblogs.com/jianshuai520/p/12915165.html