I'm getting ORA-01426: numeric overflow when running the following piece of code on Oracle 11g database:
DECLARE
TYPE my_type
IS
RECORD
(
a NUMBER,
b VARCHAR2(10) );
TYPE my_table
IS
TABLE OF my_type INDEX BY BINARY_INTEGER;
my_var my_table;
my_num1 NUMBER;
my_num2 NUMBER;
BEGIN
my_num1 := 1;
my_num2 := 781301042106240;
IF NOT my_var.EXISTS(my_num1) THEN
dbms_output.put_line('my num1 works');
END IF;
IF NOT my_var.EXISTS(my_num2) THEN
dbms_output.put_line('my num2 works');
END IF;
END;
It appears that EXISTS method can not handle the large number. But shouldn't it accept a NUMBER data type as input? Oracle documentation doesn't help much as it doesn't mention parameter's data type.
Does anyone knows what is max precision that EXISTS can accept?