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!

Zip 2+ GB file in plsql. Error when using as_zip

Sanjeev ChauhanJan 31 2014 — edited Feb 3 2014

I am using as_zip package by Anton Scheffer http://technology.amis.nl/wp-content/uploads/images/as_zip.txt

When trying to zip a 2+ GB file I get the following error

ORA-06502: PL/SQL: numeric or value error

ORA-06512: at "SYS.UTL_RAW", line 380

ORA-06512: at "SANJEEV.AS_ZIP", line 321

ORA-06512: at "SANJEEV.AS_ZIP", line 356

ORA-06512: at line 4

06502. 00000 -  "PL/SQL: numeric or value error%s"

*Cause:

*Action:

The error is being raised by the little_endian function.

function little_endian(

    p_big in number

  , p_bytes in pls_integer := 4

  )

    return raw

  is

  begin

    return utl_raw.substr

                  ( utl_raw.cast_from_binary_integer( p_big

                                                    , utl_raw.little_endian

                                                    )

                  , 1

                  , p_bytes

                  );

  end;

The function uses utl_raw.cast_from_binary_integer. I tried using utl_raw.cast_from_number but did not create the correct zip file. Has anyone found a fix for this error? The package works great for smaller files--a big thanks to Anton.

This post has been answered by Anton Scheffer on Feb 1 2014
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 3 2014
Added on Jan 31 2014
7 comments
5,060 views