I know this one seems pretty obvious, but I am at a loss.
I created a package with some types, and every was compiling fine. However, when I ran the new function, I got an error:
ORA-21700: object does not exist or is marked for delete
After a little research, I realized that the types would have to be declared outside the package.
As soon as I did that, I suddenly started getting the "not enough values" errors on all my types. I compared the number of columns being returned, and the number of columns in the type, and they match.
Here is my type code:
CREATE OR REPLACE TYPE TSA_CUSTOM.Lost_Plan as object (
LP_Key number, -- The member key of the plan that is going away
LP_Type varchar2(20),
LP_Dept varchar2(12),
LP_SubDept varchar2(12),
LP_Class varchar2(12),
LP_VendorName varchar2(50)
);
CREATE OR REPLACE TYPE TSA_CUSTOM.Target_Plan as object (
Tgt_Key number, -- The member key of the plan that the Lost plan data will be moving to
Tgt_Dept varchar2(12),
Tgt_SubDept varchar2(12),
Tgt_Class varchar2(12),
Tgt_VendorName varchar2(50)
);
CREATE OR REPLACE TYPE TSA_CUSTOM.Output_Plan as object (
LP_Result varchar2(8), -- Either 'MOVED' or 'DROPPED'
LP_Key number, -- The member key of the plan that is going away
LP_Type varchar2(20),
LP_Dept varchar2(12),
LP_SubDept varchar2(12),
LP_Class varchar2(12),
LP_VendorName varchar2(50),
Tgt_Key number, -- The member key of the plan that the Lost plan data will be moving to
Tgt_Dept varchar2(12),
Tgt_SubDept varchar2(12),
Tgt_Class varchar2(12),
Tgt_VendorName varchar2(50)
);
/
-- table of lost plans
CREATE OR REPLACE TYPE TSA_CUSTOM.Lost_Plans as table of tsa_custom.Lost_Plan;
CREATE OR REPLACE TYPE TSA_CUSTOM.Target_Plans as table of tsa_custom.Target_Plan;
CREATE OR REPLACE TYPE TSA_CUSTOM.Output_Plans as table of tsa_custom.Output_Plan;
/
and here is one of the offending snippets:
function Calc_Lost_Plan_Moves return tsa_custom.Output_Plans pipelined
is
-- define the lost plan recordset
v_LP_Store tsa_custom.Lost_Plans;
v_Tgt_Store tsa_custom.Target_Plans;
v_Output_Store tsa_custom.Output_Plans;
Begin
-- Get all the vendor class lost plans
select ep.ra_member_key , 'Vendor Class', ep.dept_cd, ep.subdept_cd, ep.class_cd, ep.vendor_name_id bulk collect into v_LP_Store
from (select distinct ra_member_key , dept_cd, subdept_cd, class_cd, vendor_name_id, class_member_id
from tsa_custom.v_ep_vendor_class) ep
,(select distinct 'CL'||class_hier_cd as class_cd, vndr_nm
from mdm_publish.v_planning_master) mdm
where ep.class_member_id = mdm.class_cd(+)
and ep.vendor_name_id = mdm.vndr_nm(+)
and mdm.class_cd is null;
Any help would be much appreciated.
Thanks!
John