首页 > 其他 > 详细

loop find column

时间:2019-05-29 20:07:38      阅读:145      评论:0      收藏:0      [点我收藏+]
 declare 
   l_sql varchar2(500);        -- variable that contains a query
   l_c   sys_refcursor;        -- cursor variable(weak cursor). 
   l_res1 VARCHAR2(60 BYTE);   -- variable containing fetching data 
   l_res2 VARCHAR2(60 BYTE);   -- variable containing fetching data 
   l_res3 date;   -- variable containing fetching data 
begin
         l_sql := SELECT column_name, table_name FROM USER_TAB_COLUMNS;
         open l_c for l_sql;
         loop
         fetch l_c into l_res1,l_res2;
         exit when l_c%notfound;   -- Exit the loop if there is nothing to fetch.  
         if l_res1 = ACCT_NUM then
            dbms_output.put_line(l_res2);
         end if;
        
        -- process fetched data 
        end loop;
        close l_c; -- close the cursor 
end; 
/
commit;

 

loop find column

原文:https://www.cnblogs.com/kakaisgood/p/10945466.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!