Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Unzip a file into Oracle directory

User_U66J8Feb 27 2018 — edited Feb 28 2018

Hi All,

I have a zip file stored in Oracle directory which I'm trying to unzip in same location.

I'm using AS_ZIP package to achieve this, but it looks like I cannot get the content of the zip ( it is containing 3 files with different structures).

declare

  t_dir varchar2(100) := 'OUH_FUSION_REFERENCE';

  t_zip varchar2(100) := 'My.zip';

  zip_files as_zip.file_list;

begin

  zip_files  := as_zip.get_file_list( t_dir, t_zip );

 

-- dbms_output.put_line(dbms_lob.getlength(zip_files));

  for i in zip_files.first() .. zip_files.last

  loop

    dbms_output.put_line( 'file: '||length(zip_files(i)) );

    END LOOP;

end;

Result I got is:

PL/SQL procedure successfully completed.

file:

file:

file:

It looks like it finds that the zip contains 3 files , but cannot get even the length...

Any ideas?

Oracle Version : Oracle Database 12c Standard Edition Release 12.1.0.2.0

Regards,

Aleks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2018
Added on Feb 27 2018
15 comments
2,631 views