Ispirer Website Ispirer Capabilities - Oracle Migration Free Trial

Oracle FOR LOOP cursor (cursorname is omitted) to HiRDB

Oracle FOR LOOP changed to FOR DO.

Oracle:

BEGIN
<<l_name>>
FOR item IN SELECT last_name, job_id FROM employees WHERE job_id LIKE '%CLERK%' AND manager_id > 120
LOOP
  DBMS_OUTPUT.PUT_LINE (item.full_name);
END LOOP l_name;
END;

HiRDB:

CREATE PROCEDURE sp_for_loop()
LANGUAGE SQL
BEGIN
 l_name:
 FOR item AS  SELECT last_name, job_id FROM employees WHERE job_id LIKE '%CLERK%' AND manager_id > 120
 DO
    WRITE LINE (item.full_name); 
 END FOR l_name;
 END;
 END_PROC

© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.