title: ORACLE expression is of wrong type on pipelined function (multiple joins table)
body: <p>I'm writting a Oracle Package with a pipelined function to get multiple records, the query is about multiple joined tables, which that will save into another table, I created a <strong>TYPE RECORD</strong> and the <strong>TABLE TYPE</strong> for the type record, then I created the pipelined function with their query, but when I compiled the package I get an error <strong>"expression is of wrong type"</strong>.</p>
  
  <p>Here are the definition package:</p>
  
  <pre><code>CREATE OR REPLACE PACKAGE MYPACKAGE_PKG AS
  
    TYPE GLD_R IS RECORD (
      ID        NUMBER,
      PRCCVE  NUMBER(7,0),        
      LOTCVE  NUMBER(7,0),        
      EPCSEQ  NUMBER(18,0),       
      EPCBNK  CHAR(3)
    );
  
    TYPE GLD_T IS TABLE OF GLD_R;    
  
    FUNCTION MY_FUNCTION(_NUM NUMBER) RETURN GLD_T PIPELINED;
  
  END;
  </code></pre>
  
  <p>Here are the body package:</p>
  
  <pre><code>CREATE OR REPLACE PACKAGE BODY MYPACKAGE_PKG AS
  
    FUNCTION MY_FUNCTION(_NUM NUMBER) RETURN GLD_T PIPELINED 
    AS
      CURSOR T_CUR IS 
        SELECT 
          T1.ID,
          T2.COLUMN01,
          T2.COLUMN02,
          T3.COLUMN01,
          T3.COLUMN02
        FROM 
          TABLE01 T1
          INNER JOIN TABLE02 T2 ON 
            T1.COLUMN03 = T2.ID
          INNER JOIN TABLE03 T3 ON
            T1.COLUMN04 = T2.ID
        WHERE 
          T1.COLUMN01 = _NUM
    BEGIN
      FOR REC IN T_CUR LOOP
        PIPE ROW (REC);
      END LOOP;
    END MY_FUNCTION;
  
  END;
  </code></pre>
  
  <p>Can you say me, what are I'm doing wrong?</p>