Hey everyone, I'm having trouble figuring out how to use UTL_COMPRESS.
What I want to do is take several BLOBs from one table, and put them into one zip file. Can anyone show me an example of where this is done?
Here is some sample code of what I have so far:
My table:
CREATE TABLE "FILES"
( "FILE_ID" NUMBER,
"FILE_TYPE" NUMBER,
"FILENAME" VARCHAR2(1000),
"DATE_ADDED" DATE,
"ADDED_BY" VARCHAR2(255),
"FILE_BLOB" BLOB,
)
/
Some sample code:
DECLARE
b_dl_file1 BLOB;
b_dl_file2 BLOB;
b_dl_file3 BLOB;
b_compressed_file BLOB;
BEGIN
select FILE_BLOB
into b_dl_file1
from FILES
where FILE_ID = 64;
select FILE_BLOB
into b_dl_file2
from FILES
where FILE_ID = 65;
select FILE_BLOB
into b_dl_file3
from FILES
where FILE_ID = 66;
b_compressed_file := UTL_COMPRESS.LZ_COMPRESS(b_dl_file1);
END;
So what I've posted works fine, it compresses a single file. What I want is to take all three of those blobs (for example) and add them to one zip file. I've looked into using UTL_COMPRESS.LZ_COMPRESS_ADD, but as far as I can see, that only takes RAW data. Will I have to break my BLOBs into RAW strings and then compress those? Will that even work?
Any help would be appreciated!