如何在 oracle10g 中查询用户(giapuser) 下字段(sjgxr) 为空的所有表?请高手指教!

解决方案 »

  1.   

    --写一个简单的过程,调用一下。。 create or replace procedure pro_test(colName varchar2)
    as
    num int;
    cursor myCursor is select table_name from user_tab_columns where column_name = upper(colName);
    begin
    for c in myCursor
    loop 
    execute immediate 'select count(1) from ' || c.table_name || ' where ' || colName || ' is null' into num;
    if num > 0 then
    dbms_output.put_line(c.table_name);
    end if;
    end loop;
    end;
    /exec pro_test('sjgxr');