CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 1999
    Posts
    6

    How to use CLongBinary in Oracle

    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


  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: How to use CLongBinary in Oracle

    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.


  3. #3
    Join Date
    Apr 1999
    Location
    VA
    Posts
    7

    Re: How to use CLongBinary in Oracle

    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


  4. #4
    Join Date
    Apr 1999
    Posts
    5

    Re: How to use CLongBinary in Oracle

    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.




  5. #5
    Join Date
    Apr 1999
    Location
    VA
    Posts
    7

    Re: How to use CLongBinary in Oracle

    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.


  6. #6
    Join Date
    Apr 1999
    Posts
    5

    Re: How to use CLongBinary in Oracle

    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.


  7. #7
    Join Date
    Jun 1999
    Posts
    2

    Re: How to use CLongBinary in Oracle

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured