Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Inserting BLOBs into Oracle via VB 3.0 and ODBC
I have some more information on our problem. I ran the small PL/SQL script below against the table containing the LONG RAW field and received the following output.
SQL> set serveroutput on
SQL> l
1 DECLARE
2 CURSOR config_cursor IS SELECT config_id, binary_file FROM config;
3 BEGIN
4 FOR config_record IN config_cursor LOOP
5 DBMS_OUTPUT.PUT(config_record.config_id); 6 DBMS_OUTPUT.PUT(': '); 7 DBMS_OUTPUT.PUT(LENGTH(config_record.binary_file)); 8 DBMS_OUTPUT.NEW_LINE;
tlsPhone3: 6222 tlsPhone1: 28442 tlsPhone5: 5008
PL/SQL procedure successfully completed.
The number represents the size of the binary_file associated with each record. All of the examples shown above work in the application. The strange part is that when the file is retrieved from Oracle and saved as an operating system file by the application, the size is shown as exactly 1/2 of the numbers above. Is there a reason for this?
Also, for files > 32K, the size of the file before insertion into Oracle, and the size of the file AFTER extraction from Oracle is the same; however the contents are not at all the same, indicating it is somehow being corrupted along the way. The size and content of files < 32K is identical.
Thanks,
Brian
-- Brian M. Biggs mailto:bbiggs_at_cincom.com Cincom Systems, Inc. voice: (513) 677-7661 http://www.cincom.com/ Brian M. Biggs <bbiggs_at_cincom.com> wrote in article <01bc2298$b30cdfb0$960112c7_at_bbiggs>...Received on Tue Feb 25 1997 - 00:00:00 CST
> Some of our developers are trying to insert BLOBs into an Oracle LONG RAW
> field and are having problems. They are using Visual Basic 3.0 and ODBC.
> On recommendation from Oracle Corporation, they are "chunking" the binary
> file into the Oracle LONG RAW field by splitting it up into "chunks" of
> 1K-4K and inserting it in pieces. Everything works fine with files
~<=32K,
> but when they cross the 32K barrier, the files end up corrupted upon
> extract back out of the database. Oracle Corporation had said that there
> were problems with files >64K, but we seem to have hit the problems with
> files 1/2 that size.
>
> Has anyone successfully insert or retrieved large BLOB data to/from
Oracle
> using VB 3.0 and ODBC? Any help at all is greatly appreciated. Please
> respond both to this newsgroup and via private e-mail.