oracle - Object not exists error while using TABLE expression -
here code: quite straight forward..
create or replace package types type rec record ( employee_id number, fname varchar2(20) ); type tab_rec table of rec; type tab_numbers table of number; type tab_chars table of varchar2(10); end types; / create or replace function get_employees_rec ( o_error_msg in out varchar2, l_access_tab out types.tab_chars ) return boolean --o_access_tab types.tab_chars; cursor c_rec select first_name employees; begin open c_rec; fetch c_rec bulk collect l_access_tab; close c_rec; return true; exception when others o_error_msg:=substr(sqlerrm,1,100); return false; end; / declare o_error_msg varchar2(100); l_access types.tab_chars; begin if get_employees_rec(o_error_msg,l_access)=false dbms_output.put_line('got you'); end if; rec in(select * employees e,table(l_access) f value(f)=e.first_name) loop dbms_output.put_line(rec.first_name); end loop; end; /
however getting error :
ora-21700: object not exist or marked delete ora-06512: @ line 9 21700. 00000 - "object not exist or marked delete" *cause: user attempted perform inappropriate operation object non-existent or marked delete. operations such pinning, deleting , updating cannot applied object non-existent or marked delete. *action: user needs re-initialize reference reference existent object or user needs unmark object.
what reason behind error?
you can't access types external package that, rather create them database objects:
create or replace type rec object ( employee_id number, fname varchar2(20)); create or replace type tab_rec table of rec;
etc.
Comments
Post a Comment