2014-01-16 33 views
0

是否可以使用FOR ... IN逐行讀取光標信息?對於光標的SQL使用FOR ... IN

例如:

var V_CURSOR REFCURSOR; 
declare 
%Some declaration 

Begin 
%Some codes where we fill up the cursor in PL/SQL section 
     FOR line IN :V_CURSOR LOOP 
      dbms_output.put_line(line); 
     END LOOP; 

End; 
/

THX

+1

你做過任何研究嗎?你應該這樣做,如果你還沒有答案,那麼在你的問題中包括你的發現。 –

+0

是的,不幸的是我是SQL新手,所以我很難找到:) – user3201492

+0

https://www.google.com/search?q=plsql+cursor+loop –

回答

0

是的,它是可能的,你還有代碼有上, 幾乎當場在遊標for..in循環的語法看起來像這個:

FOR [record_index] in [cursor_name] 
    LOOP 
     [statements] 
    END LOOP; 

希望這會有所幫助。