Oracle动态SQL查询

    xiaoxiao2023-05-26  3

    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;
    转载请注明原文地址: https://ju.6miu.com/read-1260731.html
    最新回复(0)