Advertisement
Guest User

FISCHERPLSQL

a guest
Oct 2nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.46 KB | None | 0 0
  1. DECLARE
  2.     TYPE emp_table_type IS TABLE OF
  3.         EMPLOYEES%ROWTYPE
  4.         INDEX BY PLS_INTEGER;
  5.  
  6.     emp_table emp_table_type;
  7.     counter   NUMBER(6) := 100;
  8. BEGIN
  9.  
  10.     FOR i IN
  11.         1..4
  12.         LOOP
  13.  
  14.             SELECT *
  15.             INTO emp_table(i)
  16.             FROM EMPLOYEES
  17.             WHERE EMPLOYEE_ID = counter;
  18.             counter := counter + 10;
  19.  
  20.             DBMS_OUTPUT.PUT_LINE(emp_table(i).LAST_NAME);
  21.         END LOOP;
  22.  
  23.  
  24. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement