No difference. Big difference.Depends on from where you look at the thing called a "cursor".Inside Oracle itself (the SQL Shared Pool) - no difference at all. Every single SQL parsed becomes a cursor. Oracle's SQL engine has no concept of ref cursor, or any other type of cursor. These are all just cursors. Period.From the client language (PL/SQL, Java, C#, etc) there are differences. They implement "interfaces" to that cursor in the SQL engine.PL/SQL specifically provides a couple of such interfaces: - an implicit cursor (you simply code SQL directly in PL, and it does the cursor "thing" for you) - an explicit cursor (you code the cursor definition, and the fetches from the cursor) - a DBMS_SQL cursor (the full SQL cursor interface - complex, but with a lot of additional goodies) - a reference cursor (a reference/handle/pointer to a cursor that is intended to be passed to an external client for use)Please refer: http://forums.oracle.com/forums/thread.jspa?threadID=329109
具体代码呢?
第一次循环结束后还要重头循环一次。所以要用open打开。
- an implicit cursor (you simply code SQL directly in PL, and it does the cursor "thing" for you)
- an explicit cursor (you code the cursor definition, and the fetches from the cursor)
- a DBMS_SQL cursor (the full SQL cursor interface - complex, but with a lot of additional goodies)
- a reference cursor (a reference/handle/pointer to a cursor that is intended to be passed to an external client for use)Please refer:
http://forums.oracle.com/forums/thread.jspa?threadID=329109