Oracle Magazine, Nov/Dec 2017
Database Developer PL SQL ORACLE MAGAZINE NOVEMBER DECEMBER 2017 70 l_ cursor SYS_ REFCURSOR BEGIN OPEN l_ cursor FOR q select first_ name last_ name salary from hr employees order by salary desc LOOP FETCH l_ cursor INTO l_ record EXIT WHEN l_ cursor NOTFOUND DBMS_ OUTPUT put_ line l_ employees indx name END LOOP CLOSE l_ cursor END Line s Description 2 9 Declare a record type a record variable for that type and a cursor variable to point to the dynamic result set Note that you no longer need a collection 11 14 Open the cursor for this dynamic SELECT and assign the cursor variable the pointer to the dataset 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
You must have JavaScript enabled to view digital editions.