Oracle PLS_INTEGER data type stores signed integers in the range -2,147,483,648 through 2,147,483,647, represented in 32 bits.
ORA-01426: numeric overflow
declare
p_pint1 pls_integer := 2147483645;
p_pint2 pls_integer := 13;
p_pint3 pls_integer := 9;
p_char varchar2(4) := 'ABC';
p_num_ret number;
begin
p_num_ret := mod((p_pint1+p_pint2), p_pint3);
end;
/
ERROR at line 1:
ORA-01426: numeric overflow
ORA-06512: at line 8
PL/SQL Runtime MCODE
----- PL/SQL Runtime State -----
ANONYMOUS BLOCK:
library unit=9849d118 line=8 opcode=8(ADDI) static link=0 scope=0
----- Begin Dump of MCODE -----
Entry #0
00000: BREAK
Entry #1
00002: ENTER DS[0]+136 <"__anonymous_block",ept=1,sz=208,lvl=0,prm=0>
Static Address Registers
#0000005 HS+0 |================ MCODE Mnemonics ==============
#0000006 HS+24 | MOVI: Move Integer
#0000007 HS+48 | MOVC: Move Character
#0000008 HS+72 | ADDI: Add Integer (operand and return are Integer. Interpreted as Subroutine: pfrrexc_record_excp())
00008: INFR DS[0]+184 | RASIX: Raise Exception
Frame Desc Version = 2 |===========================================================================================
slot# = 0 start offset = 16 | Comment | Test Code
# of locals = 5 |------------------------------------- |---------------------------------------------------
TC_SSCALARi: #0, FP+16, d=FP+24 | #0 <= 2147483645 |
TC_SSCALARi: #1, FP+48, d=FP+56 | #1 <= 13 | declare
TC_SSCALARi: #2, FP+80, d=FP+88 | #2 <= 9 | p_pint1 pls_integer := 2147483645;
TC_VCHARi: #3, FP+112, d=FP+136, mxl=4 cha | #3 <= 'ABC' | p_pint2 pls_integer := 13;
TC_SSCALARi: #4, FP+176, d=FP+184 | | p_pint3 pls_integer := 9;
00014: MOVI #6, #0 | #6 <= #0 (2147483645) | p_char varchar2(4) := 'ABC';
00020: MOVI #7, #1 | #7 <= #1 (13 ) | p_num_ret number;
00026: MOVI #5, #2 | #5 <= #2 (9 ) | begin
00032: MOVC #8, #3 | #8 <= #3 ('ABC ) | p_num_ret := mod((p_pint1+p_pint2), p_pint3);
00038: ADDI #6, #7, #4 | #6 + #7 => #4 (2147483645 + 13 => #4) | end;
00046: RASIX 6501 | #Throw Exception | /
----- End Dump of MCODE -----
FP=0x7f8432ae69c8 PC=0x628c39be Page=0 AP=(nil) ST=0x7f8432ae6a98 |
DL0=0x7f84319bac20 GF=0x7f84319bac68 DL1=0x7f84319bac38 DPF=0x7f84319bac58 |
HS=0x628c3bd0 AR=0x7f84319babb8 DS=0x628c3b70 |
PB_PC=(nil) SV_PC=0x628c39c6 |
DS pkg desc : |
0628C3A30 02920314 00000040 [....@...] |
0628C3A40 00020003 00000000 00000000 00000001 [................] |
0628C3A50 00D80000 0000000A 01200000 00000204 [.......... .....] |
0628C3A60 00000000 00000000 00000000 00000000 [................] |
0628C3A70 00000000 00000000 [........] |
AR : |
7F84319BABB0 32AE69D8 00007F84 [.i.2....] |
7F84319BABC0 32AE69F8 [.i.2] |
FP : |
7F8432AE69C0 00000000 00000000 [........] |
7F8432AE69D0 32AE69F0 00007F84 32AE69E0 00007F84 [.i.2.....i.2....] |
7F8432AE69E0 32AE69F0 00007F84 00080000 00000000 [.i.2............] |
7F8432AE69F0 7FFFFFFD 00007F84 32AE6A00 00007F84 [.........j.2....] | TC_SSCALARi: #0, FP+16: 7FFFFFFD = p_pint1 pls_integer := 2147483645;
7F8432AE6A00 32AE6A10 00007F84 00080000 00000000 [.j.2............] |
7F8432AE6A10 0000000D 00007F84 32AE6A20 00007F84 [........ j.2....] | TC_SSCALARi: #1, FP+48: 0000000D = p_pint2 pls_integer := 13;
7F8432AE6A20 32AE6A30 00007F84 00080000 00000000 [0j.2............] |
7F8432AE6A30 00000009 00000000 32AE6A50 00007F84 [........Pj.2....] | TC_SSCALARi: #2, FP+80: 00000009 = p_pint3 pls_integer := 9;
7F8432AE6A40 01040009 00010369 00000010 00000000 [....i...........] |
7F8432AE6A50 32AE6A60 00007F84 00280003 00000000 [`j.2......(.....] | TC_VCHARi: #3, FP+112: p_char varchar2(4) := 'ABC';
7F8432AE6A60 7F434241 00000003 00060009 00460001 [ABC...........F.] | 434241 = CBA
7F8432AE6A70 00000000 00000000 32AE6A80 00007F84 [.........j.2....] |
7F8432AE6A80 32AE6A90 00007F84 000A0000 7FFFFFFF [.j.2............] |
7F8432AE6A90 7FFFFF80 00800010 [........] | TC_SSCALARi: #4, FP+176