Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: View -v- Cursor
Any select statement, whether it comes from a view or not, creates an implicit cursor. This cursor is automatically opened for you and the cursor is closed when the statement is finished. You don't have to do anything for an implicit cursor.
An explicit cursor is one that you define in a PL/SQL block. You define the select statement for the cursor. You then open the cursor. Once the cursor is open, you can step through the output of the select statement row by row. This is very similar to stepping through an array. But you can only go forward, from the first record to the last record, and you can not skip records (unlike an array). After you are done with the cursor, you must close it manually.
For more information on cursors, refer to Oracle docs or check out Oracle 8 PL/SQL Programming by Urman on Oracle Press.
HTH,
Brian
Carl Hilton wrote:
>
> What's the difference between a view and a cursor and when should
> either be used in a query?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
-- ======================================== Brian Peasland Raytheons Systems at USGS EROS Data Center These opinions are my own and do not necessarily reflect the opinions of my company! ========================================Received on Thu Aug 17 2000 - 07:49:57 CDT