Oracle动态SQL查询

前端之家收集整理的这篇文章主要介绍了Oracle动态SQL查询前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. declare
  2. count_limit number := 10000;
  3. query_string varchar2(100) := 'select count(1) from ';
  4. total_count number;
  5. cursor c_query_user_tables is
  6. select table_name
  7. from user_tables
  8. where table_name like 'T%'
  9. order by table_name;
  10. begin
  11. for atable in c_query_user_tables loop
  12. execute immediate query_string || atable.table_name into total_count;
  13. if total_count >= count_limit then
  14. dbms_output.put_line(atable.table_name || ' ' || total_count);
  15. end if;
  16. end loop;
  17. end;

猜你在找的Oracle相关文章