Re: OCI: Array Interface - multiple inserts

From: Ole Hansen <oha_at_unispeed.com>
Date: Thu, 17 Oct 2002 12:32:34 +0200
Message-ID: <3DAE91C2.7070403_at_unispeed.com>


Hi,

Thanks. I think I finally understand how things are working.

 > for every field you'll need

This was the line I needed. I now have a working example also using OCIBindArrayOfStruct().

Do you know how many insert/sec I should expect? Right now I can insert 150 rows/sec with 10 columns. This is not much I think. The columns are a mix of varchar2 and integer. Nothing special I guess.

Thanks.
Ole

Alexander Kuznetsov wrote:
> Hi Ole,
>
> for every field you'll need
> - one OCIBind structure
> - one array of values
> - possibly one array of indicatiors
> - possibly one array of actual lengthes
>
> an excerpt from working code:
>
> ret = OCIBindByPos(m_pStmthp,
> &(pBind[colNum]),
> m_pErrhp,
> (colNum+1), //parameter position 1, 2, 3, ...
> (dvoid*)(m_pColumns[i].pData),
> //pData is an array of values
> bindLen[colNum],
> bindType[colNum],
> (dvoid*)(pInd[colNum]),
> (ub2*)((bindType[colNum] == SQLT_STR) ?
> pLen[colNum] : 0),
> (ub2 *) 0, (ub4) 0, (ub4 *) 0,
> OCI_DEFAULT)
>
> Hansen <oha_at_unispeed.com> wrote in message news:<3DAD1BD2.5060600_at_unispeed.com>...
>

>>Hi,
>>
>>I would like to speed up my inserts but I have some difficulties 
>>understanding the OCI Array Interface.
>>
>>I have say 1000 statements that all should be inserted into the same table.
>>
>>Should I build an array of structs holding the values to be inserted, 
>>ie. I must allocate 1000 structs for the statements and then bind every 
>>statement to its own struct?
>>
>>Should I have a bind handle for every struct or for every field in the 
>>struct?
>>
>>If someone could show me an example I would be very happy.
>>
>>Thanks in advance!
>>
>>Br,
>>
>>Ole Hansen

>
Received on Thu Oct 17 2002 - 12:32:34 CEST

Original text of this message