PL/SQL User’s Guide and Reference - Phần 4

Using Cursor FOR Loops In most situations that require an explicit cursor, you can simplify coding by using a cursor FOR loop instead of the OPEN, FETCH, and CLOSE statements. A cursor FOR loop implicitly declares its loop index as a %ROWTYPE record, opens a cursor, repeatedly fetches rows of values from the result set into fields in the record, and closes the cursor when all rows have been processed. Consider the PL/SQL block below, which computes results from an experiment, then stores the results in a temporary table. The FOR loop index c1_rec is implicitly declared as a record. Its fields store all the column values fetched from the cursor c1. Dot notation is used to reference individual fields.

pdf23 trang | Chia sẻ: tlsuongmuoi | Lượt xem: 1901 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu PL/SQL User’s Guide and Reference - Phần 4, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên

Các file đính kèm theo tài liệu này:

  • pdfPL-SQL User’s Guide and Reference phần 4.pdf
Tài liệu liên quan