Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467

    Unanswered: PLS-00302: component 'INTERACTION_TYPE' must be declared

    Why do I get this error when working with the objects below?

    Thanks,

    Todd



    Code:
    CREATE OR REPLACE
    TYPE question_detail_xml_type IS OBJECT (
       master_rowid                        ROWID%TYPE,
       interaction_id              VARCHAR2 (20),
       interaction_type            VARCHAR2 (20),
       interaction_user_selection  VARCHAR2 (20),
       interaction_result          VARCHAR2 (100)
    );
    /
    Code:
    CREATE OR REPLACE
    TYPE question_detail_xml_table IS TABLE OF question_detail_xml_type;
    /
    Code:
    declare
      FUNCTION report_xml (p_xml_string VARCHAR2)
      RETURN question_detail_xml_table PIPELINED
      AS
    
        TYPE xml_table IS TABLE OF question_detail_xml_table;
        xml_data xml_table;
    
      BEGIN 
    
        for i in 1..3 loop
    
          xml_data(i).interaction_id := 'ID'||to_char(i);
    
          DBMS_OUTPUT.PUT_LINE('Id = '||xml_data(i).interaction_id);
        
          xml_data(i).interaction_type := 'TYPE'||to_char(i);
    
          DBMS_OUTPUT.PUT_LINE('Type = '||xml_data(i).interaction_type);
    
        END LOOP;
    
      END report_xml;
    
    BEGIN 
    
      NULL;
    
    END;
    NOTE: Please disregard the label "Senior Member".

  2. #2
    Join Date
    Jan 2004
    Posts
    370
    What is the status of question_detail_xml_type?

  3. #3
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Not sure what you mean. It exists. Other than that I need more to go on.

    I did figure out that I could successfully compile the function if I said

    TYPE xml_table IS TABLE OF question_detail_xml_type;
    instead of
    TYPE xml_table IS TABLE OF question_detail_xml_table;
    .

    However when I run the function I get a
    ORA-06530: Reference to uninitialized composite

    I have tried using .EXTEND (no improvement) and appending "INDEX BY PLS_INTEGER" (no improvement)

    Any thoughts would be welcome.
    NOTE: Please disregard the label "Senior Member".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •