Re: Oracle LONG Problem

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 09 Jul 1998 15:07:21 GMT
Message-ID: <35a8dbb7.7896644_at_192.86.155.100>


A copy of this was sent to Ben Weber <weber_at_pjm.com> (if that email address didn't require changing) On Wed, 08 Jul 1998 16:12:52 -0400, you wrote:

>I have a Oracle database table in which there is a LONG variable
>which should be able to store values up to 2^31-1 bytes. However,
>when using embedded SQL to save a string of over 32K, i'm getting the
>following error:
>
>Error Code: 1084
>Text: Ora-01084: invalid argument in OCI call
>
>The same code works fine with values of less than 32K.
>
>Has anyone run into this before? I'm using Oracle V. 7.3 and PB 6.
>
>Thanks,
>Ben Weber

how about some code?

what calls are you using, specifically, how are you binding the insert data?

One way to do it is to pack the 4 byte length and data into one buffer

(eg:

    my_data = malloc( big_size+sizeof(long) );     *((long *)my_data) = big_size;
    memset( ((long *)my_data)+1, ...... );

    obndrv( &cda, "colname", -1, my_data, -1,

            95, -1, 0, 0, -1, -1);
....

(thats actually the bind type for a long raw -- 95, need to change for a long)  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Jul 09 1998 - 17:07:21 CEST

Original text of this message