I am trying to use an Oracle 9.2 database to distribute some DLL file types among multiple workstations. The problem that I'm having is that after uploading the DLL into the database, it exports as a larger file than I uploaded. The exported file is also no longer recognized as a DLL file. What am I missing?
This is my import code:
INSERT INTO fpi_versions
VALUES ('&version', empty_blob())
RETURN fpi_dll INTO v_blob;
This is my export code:
v_amount BINARY_INTEGER := 32767;
v_pos INTEGER := 1;
-- Get LOB locator
WHERE version = '&version';
v_blob_len := DBMS_LOB.GETLENGTH(v_blob);
-- Open the destination file.
v_file := UTL_FILE.FOPEN('DBDIR','fpi32p.dll','w', 32767);
-- Read chunks of the BLOB and write them to the file
-- until complete.
WHILE v_pos < v_blob_len LOOP
DBMS_LOB.READ (v_blob, v_amount, v_pos, v_buffer);
UTL_FILE.PUT_RAW(v_file, v_buffer, TRUE);
v_pos := v_pos + v_amount;
-- Close the file.
WHEN OTHERS THEN
-- Close the file if something goes wrong.
IF UTL_FILE.IS_OPEN(v_file) THEN