Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OCI: How can I speed up multiple inserts?

OCI: How can I speed up multiple inserts?

From: Ole Hansen <oha_at_unispeed.com>
Date: Thu, 26 Sep 2002 13:49:37 +0200
Message-ID: <3D92F451.3030101@unispeed.com>


Hi,

I would like to insert say 1000 rows, and in my application I receive a char array with all the statements like - array[0]: insert into ..., array[1]: insert into ...

All statements are for the same catalog/table.

Should I call OCIStmtPrepare/OCIStmtExecute for all indices in the char array (as I do now), or could I speed up things by doing something different? What?

Although all inserts are for the same table they might not all include values for all columns. The table could have 4 columns like:

Eg.:

array[0]: insert into some_table (a,b,c) values (1,2,3);
array[1]: insert into some_table (a,c) values (4,5);
array[2]: insert into some_table (a,c,d) values (7,1,4);
array[3]: insert into some_table (a,b,c,d) values (3,3,5,2);
etc.

Rigth now it's like:
i = 0;
while (array[i]) {
OCIStmtPrepare( ..., array[i], ...);
OCIStmtExecute(...);
i++;
}

How can I speed up things?

Thanks in advance.
Br,
Ole Hansen Received on Thu Sep 26 2002 - 06:49:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US