0

I have table function which returns table of file names (type t_file_list is table of clob;) from .zip file (in BLOB format) the header is like:

  function get_file_list(
    p_zipped_blob in blob
   ,p_encoding in varchar2 := null
  )
    return t_file_list
  is
  .....
  end;

and I need to select these file names and for each call some procedure, but i cant find way to call function get_file_list correctly, I try this:

  for i in (select * from table(zip_util_pkg.get_file_list(ab_zipped_blob))) 
  loop
    .....
  end loop;

but it gives me some errors like ORA-22905 and PLS-00642. Can someone tell me what I am doing wrong and how to call table function correctly?

Silverrook
  • 51
  • 1
  • 2
  • 8
  • Is this type: `type t_file_list is table of clob;` declared in the package ? Or at the databae level ? – krokodilko Feb 25 '16 at 20:08
  • it is declared in both packages (in `zip_util_pkg` and in package where I need to call the function `get_file_list`) – Silverrook Feb 25 '16 at 20:12

1 Answers1

3

No need to use SQL - you can do it entirely in PL/SQL:

DECLARE
  p_files ZIP_UTIL_PKG.T_FILE_LIST;
BEGIN
  p_files := zip_util_pkg.get_file_list(ab_zipped_blob);
  FOR i IN 1 .. p_files.COUNT LOOP
    some_procedure( p_files(i) );
  END LOOP;
END;
/
MT0
  • 143,790
  • 11
  • 59
  • 117