declare
count_limit number := 10000;
query_string varchar2(100) := 'select count(1) from ';
total_count number;
cursor c_query_user_tables is
select table_name
from user_tables
where table_name like 'T%'
order by table_name;
begin
for atable in c_query_user_tables loop
execute immediate query_string || atable.table_name into total_count;
if total_count >= count_limit then
dbms_output.put_line(atable.table_name || ' ' || total_count);
end if;
end loop;
end;
Oracle动态SQL查询
最新推荐文章于 2024-09-13 08:02:47 发布