标签:
本人今天写的第一个存储过程
1 create or replace procedure proc_search_table as 2 var_owner varchar2(100):=‘‘; 3 var_name varchar2(100):=‘‘; 4 var_exists varchar2(10):=‘0‘; 5 cursor mycur is 6 SELECT OWNER,table_name FROM DBA_TABLES t where t.OWNER in (‘ZXJS‘,‘GNU_BI‘,‘GROUPBESTTONE‘,‘ZXCF‘) ; 7 begin 8 open mycur; 9 loop 10 fetch mycur 11 into var_owner,var_name; 12 select nvl(count(1),0) into var_exists from dba_source t where t.text like ‘%‘||var_name||‘%‘; 13 if var_exists = ‘0‘ then 14 insert into huzj_pro_search_table_20160715 values(var_owner,var_name); 15 else 16 insert into huzj_pro_search_table_20160715 values(‘1‘,‘1‘); 17 end if; 18 exit when mycur%notfound; 19 end loop; 20 commit; 21 end proc_search_table;
标签:
原文地址:http://www.cnblogs.com/janehoo/p/5674585.html