解決ora-20005的遊標

season0891發表於2010-02-08
DECLARE CURSOR X1 IS
select owner,table_name from dba_tab_statistics
where wner='MVUSER2010' AND STATTYPE_LOCKED is not null and rownum <100;
v_eowner dba_tab_statistics.owner%type;
v_tname  dba_tab_statistics.table_name%type;
begin
open X1;
loop
fetch X1 INTO v_eowner,v_tname;
exit when X1%notfound;
dbms_output.put_line('exec dbms_stats.unlock_table_stats('||chr(39)||v_eowner||chr(39)||','||chr(39)||v_tname||chr(39)||');');
end loop;
close X1;
end;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-627011/,如需轉載,請註明出處,否則將追究法律責任。

相關文章