I have defined a type in oracle.
Quote: |
desc emptype;
Name Null? Type
----------------------------------------- -------- -------
emp_no NUMBER
emp_name VARCHAR2(40)
dept_no NUMBER
|
Here is the code
set serveroutput on
DECLARE
emptab emptype:=emptype();
begin
-- calling a function which returns collection type
custom_pkg.get_emp_date(emptab);
IF (emptab.COUNT > 0) THEN
FOR i IN emptab.FIRST..emptab.LAST LOOP
DBMS_OUTPUT.PUT_LINE(emptab.emp_no(i));
DBMS_OUTPUT.PUT_LINE(emptab.emp_namei));
DBMS_OUTPUT.PUT_LINE(emptab.dept_no(i));
END LOOP;
END IF;
end;
But I am getting the following error.
Quote: |
ORA-06550: line 11
PLS-00302: component 'emp_no' must be declared
ORA-06550: line 12
PLS-00302: component 'emp_name' must be declared
ORA-06550: line 13
PLS-00302: component 'dept_no' must be declared
|
What may be wrong here?
Thanks in advance.