Limits of PL/SQL FOR...LOOP variable?
Date: Tue, 27 Sep 2022 12:10:38 -0500
Message-ID: <CAANsBX01jYscunbxet-MjDa3vk5v6QSs8AE43iM2Nq98MTQzPQ_at_mail.gmail.com>
Howdy,
In 19.16, a dev has a quick anonymous block that fails with "ORA-1426:
numeric overflow". It appears that the FOR...LOOP has a limit of 2G-1. I
can't see where that would be documented or there's some implicit typing
going on that I'm missing. From experimentation:
DECLARE
This works. Bumping the end sequence up by 1 and it fails at the FOR
statement with ORA-1426 and nothing is output, so at compile time. I've
tried adding an explicit declaration of "x", changing them all to
NUMBER(12) or PLS_INTEGER, but still get the same error. I can't find any
reference to this limit at:
sseq NUMBER:=2147483647;
eseq NUMBER:=2147483647;
BEGIN
FOR x IN sseq..eseq LOOP
dbms_output.put_line(TO_CHAR(x));
END LOOP;
/
https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/database-limits.htm
Am I missing something (very possible) or is this an undocumented limit?
Thanks,
Rich
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Sep 27 2022 - 19:10:38 CEST