I am trying to figure out when the use of the RANGE clause is permitted in the definition of a variable in the declarative section of a PL / SQL block.
The following code has been tested on Oracle 12c
It works...
declare
l_constrained PLS_INTEGER RANGE 7..10 ;
begin
l_constrained := 9;
end ;
/
This gives a compilation error ...
declare
l_constrained NUMBER(2) RANGE 7..10 ;
begin
l_constrained := 9;
end ;
/
This seems to work only when applied to PL / SQL data types, not SQL data types, but this is just my first impression.
Can someone please give me some information and perhaps lead me in the official Oracle documentation covering the use of the RANGE clause? I can not find him...
source
share