Ispirer Website Ispirer Capabilities - Oracle Migration Free Trial

Oracle LOOP to HiRDB

SQLWays changes LOOP statement to WHILE statement. 'LOOP' is replaced with 'WHILE 1=1 DO' and 'END LOOP' is replaced with 'END WHILE'.

Oracle:

Declare empno number;
Begin 
empno := 2; 
<<label_name>> 
loop 
empno := empno + 1; 
if empno > 5 then 
exit; 
end if; 
end loop label_name; 
end;

HiRDB:

CREATE PROCEDURE loop_st()
LANGUAGE SQL 
Begin 
 DECLARE empno FLOAT; 
 SET empno = 2; 
 label_name: 
 WHILE 1=1 DO 
    SET empno = empno+1; 
    if empno > 5 then 
       leave label_name; 
    end if; 
 END WHILE label_name; 
end;
END_PROC

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