declare
cursor v_cursor is
select t1.table_name,t1.comments as uc_comments,t2.comments as ut_comments
from user_col_comments t1,user_tab_comments t2
where t1.table_name=t2.table_name
order by t1.table_name;
v_table_name varchar2(4000):='';
v_uc_comments varchar2(4000):='';
begin
for v_i in v_cursor loop
if v_i.table_name!=v_table_name then
begin
if v_uc_comments like '%账号%' and v_uc_comments like '%证件%' then/*账号和证件可替换成其他*/
begin
--dbms_output.put_line('v_uc_comments:'||v_uc_comments);
dbms_output.put_line('');
dbms_output.put_line('dbms_output.put_line:'||v_i.ut_comments||' '||v_i.table_name);
end;
end if;
v_uc_comments:=v_i.uc_comments;
end;
else
begin
v_uc_comments:=v_uc_comments||v_i.uc_comments;
end;
end if;
v_table_name:=v_i.table_name;
end loop;
end;
Oracle使用游标在user_col_comments和user_tab_comments寻找user_col_comments的comments同时包含‘账号’和‘证件’的表名
最新推荐文章于 2023-10-26 07:43:33 发布