Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 10.3.9
-
Fix Version/s: 10.3.11
-
Component/s: Parser
-
Labels:None
-
Environment:Centos 7
Description
Release tested: 10.3.9
The following loop did not produce any output. It worked correctly without the REVERSE key word.
SET SQL_MODE=ORACLE; |
delimiter //
|
#
|
DECLARE |
totalprice DECIMAL(12,2):=NULL; |
loop_start INTEGER := 1; |
BEGIN |
FOR idx IN REVERSE loop_start..10 LOOP |
SELECT idx; |
END LOOP; |
END; |
//
|
With the REVERSE key word, switching the lower and upper bound values also worked:
FOR idx IN REVERSE 10..loop_start LOOP
However, this behavior is different from Oracle's documentation below.
---------
If REVERSE is specified:
If upper_bound is less than lower_bound, the statements do not run, and control transfers to the statement after the FOR LOOP statement.
---------