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