Small package of zip/unzip function which used java in Oracle stored procedure.
For use:
- Copy and compile file ZipUtility.java in Oracle-compatible IDE
- Next time copy and compile package_header.ddl and package_body.ddl
- Ready for use.
Example:
- Create test table and insert data:
create table test_table (id number, attachment clob);
insert into test_table (id, attachment) values (1, 'It is a just test data: Save me! I am hungry russian developer... I dream to leave this place.');
- Use package functions:
select t.attachment,
zip_utility.zip(t.attachment),
zip_utility.unzip(zip_utility.zip(t.attachment))
from test_table t