oracle10g 中查询用户(giapuser)下字段(sjgxr)为空的所有表。
请高手指点!

解决方案 »

  1.   

    字段(sjgxr)为空  是指全部为空还是有一条为空的记录即可。??
      

  2.   

    补充一下:比如在giapuser用户下有100张表,其中大约有60张表里含有数据更新人(sjgxr)字段,现在需要查出giapuser下有那些表中的sjgxr为空的!包括有一条为空的记录也有列出来。 敬请指点一二。
      

  3.   

    写一个简单的过程,调用一下。。
    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');