Hi friends.
I created a table like this:
CREATE TABLE blob_test (
line_id number(2) PRIMARY KEY,
b_file BLOB,
b_embedded BLOB);
then I created a new line with empty blobs:
INSERT INTO blob_test VALUES (1, EMPTY_BLOB(), EMPTY_BLOB());
I want to store a file in the database from an Ole Server (e.g. MS PowerPoint) to use in datawindow reports.
If the file is stored using the script below, the size in the database is the same from the file (the file size is 432kb):
INT li_handle
BLOB lbl_blob
li_handle = FileOpen("xyz.pptx", StreamMode!, Read!)
FileReadEx(li_Handle, lbl_blob)
FileClose(li_Handle)
UPDATEBLOB blob_test SET b_file = :lbl_blob WHERE line_id = 1;
COMMIT;
SQL> SELECT
2 TRUNC(DBMS_LOB.GETLENGTH(b_file) / 1024) size_b_file,
3 TRUNC(DBMS_LOB.GETLENGTH(b_embedded) / 1024) size_b_embedded
4 FROM blob_test;
SIZE_B_FILE SIZE_B_EMBEDDED
----------- ---------------
432 0
But, if we use an OleControl or OleDataBaseBlob to load and store the embedded file, the size in the database is increased by more than 2000% (the same file with 432k is stored with 8800kb)...
BLOB lbl_blob
ole_pptx.insertFile("xyx.pptx")
lbl_blob = ole_pptx.objectData
UPDATEBLOB blob_test SET b_embedded = :lbl_blob WHERE line_id = 1;
COMMIT;
SQL> SELECT
2 TRUNC(DBMS_LOB.GETLENGTH(b_file) / 1024) size_b_file,
3 TRUNC(DBMS_LOB.GETLENGTH(b_embedded) / 1024) size_b_embedded
4 FROM blob_test;
SIZE_B_FILE SIZE_B_EMBEDDED
----------- ---------------
432 8800
Please could anyone let me know why and if there is a way to avoid this?
I am using:
PowerBuilder 10.5.2
Windows 7-32 bits
Oracle Client 11.2.0.1.0 32-bits
Oracle Server 12.1.0.1.0 64-bits
Thank you.