Skip to content

Instantly share code, notes, and snippets.

@velll
Created July 10, 2017 10:02
Show Gist options
  • Save velll/c789da1cd625659f660b9b351ebd0e61 to your computer and use it in GitHub Desktop.
Save velll/c789da1cd625659f660b9b351ebd0e61 to your computer and use it in GitHub Desktop.
Increase varray size!
CREATE OR REPLACE TYPE NUMBER_ARRAY AS VARRAY(2) OF NUMBER
create table tab_with_arr(
id number,
val NUMBER_ARRAY)
insert into tab_with_arr
select 1, number_array(1,2,3,4,5)
from dual
-- Error!
insert into tab_with_arr
select 1, number_array(1,2)
from dual
-- ok!
ALTER TYPE NUMBER_ARRAY MODIFY LIMIT 5 INVALIDATE;
insert into tab_with_arr
select 1, number_array(1,2,3,4,5)
from dual
-- ok!
select t.id, c.column_value
from tab_with_arr t,
table(t.val) c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment