title: Oracle function return table of record type that defined in package specification
body: <p>I have a function that gets a string and delimiter as an input parameters and return the the splitted strings as a table.
  when I run this function:</p>
  
  <pre><code>create or replace PACKAGE split_pkg AS
  TYPE triplex_record IS RECORD (
                  id      NUMBER,
                  data    VARCHAR2(4000),
                  data1   VARCHAR2(4000),
                  data2   VARCHAR2(4000)
                  );
  TYPE triplex_tab IS TABLE OF triplex_record;
  FUNCTION triplex (p_txt IN VARCHAR2, p_delimiter IN VARCHAR2) RETURN triplex_tab ;
  END split_pkg;
  /
  create or replace PACKAGE BODY split_pkg AS
  FUNCTION triplex (p_txt IN VARCHAR2, p_delimiter IN VARCHAR2)
      RETURN triplex_tab
  AS
      triplex_tbl     triplex_tab := triplex_tab();
  BEGIN
      FOR i IN 1..TRUNC((REGEXP_COUNT(p_txt , '[^' || p_delimiter || ']+'))/3)
      LOOP
          triplex_tbl.EXTEND;
          triplex_tbl(triplex_tbl.LAST).id := i;
          triplex_tbl(triplex_tbl.LAST).data := TRIM(REGEXP_SUBSTR(p_txt, '[^' || p_delimiter || ']+' , 1, 3 * i - 2));
          triplex_tbl(triplex_tbl.LAST).data1 := TRIM(REGEXP_SUBSTR(p_txt, '[^' || p_delimiter || ']+' , 1, 3 * i - 1));
          triplex_tbl(triplex_tbl.LAST).data2 := TRIM(REGEXP_SUBSTR(p_txt, '[^' || p_delimiter || ']+' , 1, 3 * i));
          --PIPE ROW(triplex_tbl);
      END LOOP;
      RETURN triplex_tbl;
  END triplex;
  END split_pkg;
  </code></pre>
  
  <p>I get below error:</p>
  
  <blockquote>
    <p>ORA-00902: invalid datatype</p>
  </blockquote>
  
  <p>I have no problem if create as a PIPELINED function and I only want to define my TYPEs in PACKAGE's header with RECORD TYPE not at schema level with CREATE TYPE. How can do that?</p>