Cursors Cursor for Oracle

Source: Internet
Author: User

6, how to use the display cursor,? How do I traverse a circular cursor?
① using Display Cursors
⑴ declares a cursor: divides the storage area, noting that the SELECT statement is not executed at this time.
cursor cursor name (parameter list) [return value type] is Select statement;
⑵ Open cursor: Executes a SELECT statement to obtain the result set stored in the cursor, at which point the cursor points to the result set header instead of the first record.
Open cursor name (parameter list);
⑶ Get record: Move cursor fetch a record
Fetch cursor name into temporary record or attribute type variable;
⑷ closes the cursor: puts the cursor in the buffer pool without fully releasing the resource. can be reopened.
Close cursor name;
② traversing a loop cursor
⑴for Loop Cursors
Loop Leng Open the cursor, automatically scroll to get a record, and automatically create a temporary record type variable to store the record. The cursor is automatically closed when finished processing.
For variable name in cursor name
Loop
Data processing statements;
End Loop;
⑵loop Loop Cursors
。。。
Loop
Fatch cursor name into temporary record or attribute type variable;
Exit when cursor name%notfound;
End Loop;

Cursors Cursor for Oracle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.