Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is maximum rows count in oracles nested table

CREATE TYPE nums_list AS TABLE OF NUMBER;

What is maximum possible rows count in oracle's nested table ?

UPDATE

CREATE TYPE nums_list  AS TABLE OF NUMBER;

CREATE OR REPLACE  FUNCTION  generate_series(from_n NUMBER, to_n NUMBER)
RETURN nums_list AS
ret_table nums_list := nums_list();
BEGIN

  FOR i IN from_n..to_n LOOP
    ret_table.EXTEND;
    ret_table(i) := i;
  END LOOP;
  RETURN ret_table;

END;


SELECT count(*)   FROM TABLE ( generate_series(1,4555555) );

This gives error: ORA-22813 operand value exceeds system limits, Object or Collection value was too large

like image 989
Oto Shavadze Avatar asked May 07 '26 17:05

Oto Shavadze


1 Answers

The range of subscripts for a nested table is 1..2**31 so you can have 2**31 elements in the collection. That limit hasn't changed since at least 8.1.6 though, of course, it might change in the future.

like image 189
Justin Cave Avatar answered May 10 '26 08:05

Justin Cave



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!