Still getting Compilation errors in scott.emp

Hi Experts,
I am getting a compilation errors when i compile a package body:
CREATE OR REPLACE PACKAGE TABLE_EXAMPLE AS
TYPE TNAME IS RECORD(PARAMETER EMP%ROWTYPE,VALUE EMP%ROWTYPE);
TYPE TABLET IS TABLE OF TNAME;
TYPE EMP_TABLE IS TABLE OF EMP%ROWTYPE;
PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET);
END;
CREATE TABLE TAB_PAR
  (PARAMETER  VARCHAR2(100 ),
  PA_VALUE   VARCHAR2(100)
create or replace package body table_example as
PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET) as
l_emp_tbl emp_table:=emp_table() ;
cursor c is select * from emp;
err_msg varchar2(1000);
err_code number;
begin
for m in 1..arg.count loop
insert into tab_par(parameter,pa_value) values (arg(m).parameter,arg(m).value);
end loop;
exception
when others then
err_msg:=sqlerrm;
err_code:=sqlcode;
dbms_output.put_line(sqlerrm);
end;
end  table_example;
Warning: Package Body created with compilation errors.
LINE/COL ERROR
20/49    PLS-00382: expression is of wrong type
20/66    PLS-00382: expression is of wrong typeHow do i resolve this?
Thanks.

I recreated according to your suggestions but i am still getting the errors:
CREATE OR REPLACE PACKAGE TABLE_EXAMPLE2 AS
TYPE TNAME IS RECORD(P_PARAMETER varchar2(100),P_VALUE varchar2(100));
TYPE TABLET IS TABLE OF TNAME;
PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET);
END;
create or replace package body table_example2 as
PROCEDURE P1(ARG IN TABLE_EXAMPLE.TABLET) as
begin
for m in 1..arg.last loop
insert into tab_par(parameter,pa_value) values (arg(m).p_parameter,arg(m).p_value);
end loop;
end;
end  table_example2;
LINE/COL ERROR
9/1      PL/SQL: SQL Statement ignored
9/49     PLS-00382: expression is of wrong type
9/49     PL/SQL: ORA-22806: not an object or REF
9/56     PLS-00302: component 'P_PARAMETER' must be declared
9/68     PLS-00382: expression is of wrong type
9/75     PLS-00302: component 'P_VALUE' must be declared

Similar Messages

Maybe you are looking for