利用游標(cursor)

create or replace procedure p10
is
table_name varchar2(10);
cursor cur1 is
select table_name from user_tables;
begin
open cur1;
loop
fetch cur1 into table_name;
exit when cur1%NOTFOUND;
dbms_stats.gather_table_stats('user1',table_name);
dbms_output.put_line('susess'||table_name);
end loop;
close cur1;
end;

 

set serveroutput on;
exec p10;

已編譯 PROCEDURE p10
匿名區塊已完成
susessT
susessT1
susessT2

文章標籤
全站熱搜
創作者介紹
創作者 to52016 的頭像
to52016

Eason [資料科學//Python學習/資料庫] & [拍片&剪片]

to52016 發表在 痞客邦 留言(0) 人氣(18)