Click to See Complete Forum and Search --> : How to use CLongBinary in Oracle
nunomas
April 23rd, 1999, 07:06 AM
Hi,
We have implemented a program in vc++ that write records with BLOB columns in sql server. That program bound the BLOB columns to CLongBinary objects.
We are trying to change that program to run under Oracle instead of Sql server. We have just change de openning of database(OpenEx) and we have created a RecordSet for Oracle that bound the BLOB columns to CLongBinary too. But it didnīt work. When we run the program, it returns the following error:
ORA-01461: can bind a LONG value only for insert into a LONG Column.
Does anyone know whats the problem?
Thanks
Nuno Santos
Bob C.
April 26th, 1999, 12:49 PM
We are running Oracle 8.05 with Intersolv 3.5 ODBC drivers. The BLOB columns work only if the Recordset is defined as a snapshot, and the CDatabase::useCursorLib flag is set during OpenEx. Also, the BLOB columns are bound to CByteArray objects. When dynaset is selected, or the CursorLib is not used, the error ORA-01461 is returned.
Dan Robbins
April 30th, 1999, 10:55 AM
I have just started to work on a similar project.
We have Oracle 8.05, and a table containing BLOBs. I tried to derive a CRecordset class using that table and having ClassWizard bind the columns to variables for me, but it didn't like the BLOBs, and created vars of type "INVALID". This was using the MS ODBC for Oracle driver.
I tried the same procedure using the Oracle 8.00.05 ODBC driver, and Class Wizard gave me CStrings for the BLOB columns- not exactly what I was expecting.
Can anyone shed some light on this subject? Shouldn't I get a CLongBinary or CByteArray? Do I have to bind the BLOBs myself? Or maybe use a different ODBC driver?
Thanks in advance,
-Dan
Bob C.
May 3rd, 1999, 04:54 PM
The Intersolv (now Merant) Oracle 8 driver works with BLOBS. Go to the www.merant.com site and download the evaluation version to see if it works for you. Remember that you also need to have Oracle's Net8 installed on the client machine. Also, the Oracle ODBC driver did not work for me either.
Dan Robbins
May 5th, 1999, 09:43 AM
Thanks, that worked great.
On a related note, how do you deal with "data truncated" and retrieving more than 255 bytes of data with a CByteArray? I changed nMaxLength in RFX_Binary to a larger value, which works, but might not be the smartest way.
Bob C.
May 5th, 1999, 10:42 AM
Unfortunately, we have not found a way around this either. For now, I have defined a MAX_BLOB constant at 100K bytes which fits our needs, but future changes may necessitate a larger size. I would hate to have to recompile every time the blob exceeded the max.
ifi
June 22nd, 1999, 11:40 PM
Dear Sir,
I am trying to save .WAV file into MS SQL Servers's 'image' field. I am unable to store and retrieve data from it.
Please send me any example if possible...
regards
ifi
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.