Skip to content

Instantly share code, notes, and snippets.

@velppa
Last active December 19, 2015 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velppa/5883997 to your computer and use it in GitHub Desktop.
Save velppa/5883997 to your computer and use it in GitHub Desktop.
You can't use Nested Table declared in anonymous PL/SQL block in SQL context.
declare
TYPE row_nt IS TABLE OF number;
a row_nt;
cursor a_cur is
select level from dual connect by level <= 100;
n number;
begin
open a_cur;
fetch a_cur bulk collect into a;
close a_cur;
dbms_output.put_line(a.COUNT);
select count(column_value)
into n
from table(a); -- ERROR HERE
end;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment