Running Some PL/SQL Code – Installation of a Containerized Oracle Database Instance and SQL Developer

Running Some PL/SQL Code Let’s now review one of the earlier PL/SQL examples, as shown in Example 2-8. Example 2-8. Cursor use in PL/SQL DECLARECURSOR c1 isSELECT ename,empno,salFROMemp         ORDER BY sal DESC;— start with highest paid employeemy_ename VARCHAR2(10);my_empno NUMBER(4);my_sal  NUMBER(7,2); BEGINOPEN c1;   FOR i IN 1..5 LOOPFETCH c1 INTOmy_ename,my_empno,my_sal;EXIT WHEN c1%NOTFOUND; /* in case the number requested *//* is more than the total       *//* number of employees          */ INSERTINTOtempVALUES(my_sal,my_empno, my_ename);COMMIT;END LOOP;CLOSE c1;END; To run the code in […]