title: PL/SQL code error for using the function from an object type
body: <p>I want to use the procedure I declare in type student_typ to print out all the student records using a PL/SQL table. But it does not seem to work.</p>
  
  <p>Here is my codes:</p>
  
  <pre><code>CREATE TYPE student_typ AS OBJECT (
  idno        NUMBER,
  first_name  VARCHAR2(20),
  last_name   VARCHAR2(25),
  email       VARCHAR2(25),
  phone       VARCHAR2(20),
  MAP MEMBER FUNCTION get_idno RETURN NUMBER,
  MEMBER PROCEDURE display_details ( SELF IN OUT NOCOPY student_typ ));
  
  CREATE TYPE BODY student_typ AS
  MAP MEMBER FUNCTION get_idno RETURN NUMBER IS
  BEGIN
     RETURN idno;
  END;
  MEMBER PROCEDURE display_details ( SELF IN OUT NOCOPY student_typ ) IS
  BEGIN
     -- use the PUT_LINE procedure of the DBMS_OUTPUT package to display details
     DBMS_OUTPUT.PUT_LINE(TO_CHAR(idno) || ' ' || first_name || ' ' || last_name);
     DBMS_OUTPUT.PUT_LINE(email || ' ' || phone);
  END;
  END;
  CREATE TABLE student_obj_table OF student_typ;
  
  INSERT INTO student_obj_table VALUES (
  student_typ (935, 'Julie', 'Brown', 'jbrown@bentley.edu', '1-800-555-1313') ); 
  
  INSERT INTO student_obj_table VALUES (
  936, 'Julia', 'Blue', 'jblue@bentley.edu', '1-800-555-1314'); 
  
  SELECT VALUE(s) FROM student_obj_table s
  WHERE s.last_name = 'Brown';
  </code></pre>
  
  <p>The above codes are all correct.</p>
  
  <p>Here is my PL/SQL block:</p>
  
  <pre><code>DECLARE
  student student_typ;
  cursor find is select * from student_obj_table;
  BEGIN -- PL/SQL block for selecting-displaying a student
    for find_rec in find loop
       student:=find_rec.student_typ;
       student.display_details();
    end loop;
  END;
  </code></pre>
  
  <p>I want to know what is wrong with my PL/SQL block that it gives me this error message and how to correct it:</p>
  
  <pre><code>Error report -
  ORA-06550: line 6, column 24:
  PLS-00302: component 'STUDENT_TYP' must be declared
  ORA-06550: line 6, column 6:
  PL/SQL: Statement ignored
  06550. 00000 -  "line %s, column %s:\n%s"
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </code></pre>