17,377
社区成员
发帖
与我相关
我的任务
分享
set serverout on
/
declare
rscount int ;
strsql varchar(200) ;
begin
for x in (select t.tname , c.cname
from col c, tab t
where c.tname = t.tname and t.tabtype ='TABLE' and coltype in('VARCHAR2','VARCHAR','CHAR')
)
loop
strsql := 'select count(*) from ' || x.tname || ' where ' || x.cname || ' =''内容''';
execute immediate strsql into rscount ;
if rscount > 0 then
dbms_output.put_line(x.tname || '.' || x.cname) ;
end if ;
end loop ;
end ;
/