Database SQL / Scripts for '#Cursor' - 1 Query/Script(s) found
Sample 1. Cursor to get Ids from one table and then insert records into another ( Get Employee Ids from EMPLOYEE Table and insert records within EMPLOYEE_SALARY with default salary of 1000 )
DECLARE
cursor employeeIds IS
select * from EMPLOYEE;
BEGIN
FOR rec IN employeeIds LOOP
INSERT INTO EMPLOYEE_SALARY(ID, SALARY) VALUES(rec.ID, 1000);
END LOOP;
END;