Home > Default > The efficiency of oci program with OCI_COMMIT_ON_SUCCESS

The efficiency of oci program with OCI_COMMIT_ON_SUCCESS

November 30Hits:0
Advertisement
I have write a demo program to insert 1000 row data into a tab.
As I want to commit at every insert operation, I call OCIStmtExecute with OCI_COMMIT_ON_SUCCESS parameter.
And the time cost for each row is between 5ms and 10 ms.
At the same time, insert data using SQL:
declare
return_res number(4);
aa1 varchar(15);
aa2 varchar(150);
aa3 varchar(150);
aa4 varchar(150);
aa5 varchar(150);
aa6 varchar(150);
begin
for i in 1..1000 loop
aa1 := '13900000001';
aa2 := '000102030405060708090a0b0c0d0e0f';
aa3 := '000102030405060708090a0b0c0d0e0f';
aa4 := '000102030405060708090a0b0c0d0e0f';
aa5 := '000102030405060708090a0b0c0d0e0f';
aa6 := '000102030405060708090a0b0c0d0e0f';
insert into avinfotab_3g1 values(i,aa1,aa2,aa3,aa4,aa5,aa6);
commit;
select count(*) into return_res from avinfotab_3g1;
delete from avinfotab_3g1 where strsImsi = '13900000001';
commit;
end loop;
end;
result:
Command was executed successfully
Executed: 6/2/09 4:10:27 PM CST Execution: 922/ms
It's cost less than 1ms per row.
Why the OCI program's efficiency so low?
Edited by: bigtreefxs on 2009-6-2 下午11:06
Edited by: bigtreefxs on 2009-6-2 下午11:08

Answers

As wel the commit in the pl/sql block is executed as part of one pl/block executed on the server.
If you do the execute in oci from a client app, you have as many roundtrips as execution...

Read other 4 answers

Tags:

Related Articles

  • The efficiency of oci program with OCI_COMMIT_ON_SUCCESSNovember 30

    I have write a demo program to insert 1000 row data into a tab. As I want to commit at every insert operation, I call OCIStmtExecute with OCI_COMMIT_ON_SUCCESS parameter. And the time cost for each row is between 5ms and 10 ms. At the same time, inse

  • Error when running a oci programOctober 11

    I have a oci program copiled on solaris.when i try to run it in another machine it stops giving a strange message:: I get the following error message. fatal: relocation error: file sqlplus: symbol naemd5s: reference symbol not found : killed nulli'm

  • Setting module name in OCI programOctober 11

    Hi, I have been struggling with setting the module name from my OCI program. Below is the code in which I create the environment, connect, attempt to set the module attribute, wait for key input, and clean up and exit after getting the key input. Tha

  • An oci program compiled with oracle 9 run in a machine has oracle client 10November 30

    Hello, I would like to know if an OCI program compiled with Oracle 9 client libraries can communicate with Oracle 9 and Oracle 8 database servers by using the oracle client 10 on Solaris? Is there any known problem of this combination? Many thanks,It

  • Value of OCI_ATTR_CHARSET_ID for OCI programmingNovember 30

    While learning OCI programming I need to know all values of OCI_ATTR_CHARSET_ID. Only in examples I know that 873 is for UTF8, 31 is for ISO-8859-1 and so on. Who can tell me where I can find the values of all encodings? Thank you in advance.1) Use L

  • Compiling OCI Programs using Turbo C++ 3.0 for WindowsNovember 30

    Hi everybody here, I have Turbo C++ 3.0 installed on my Windows 2000 machine. However the batch files containing commands for compiling the sample OCI source code files which come alongwith the Oracle 8.1.6 (installed on the same Windows 2000 machine

  • How to compile Reports sample OCI program in Sun solaris ?November 30

    TO All: Here is reports OCI sample program. #include <stdio.h> long ret,rwcrun(),rwcsql(); main() char options[132]; long len; strcpy(options,"userid=ps51/ps51 report=emp batch=yes paramform=no destype=file desname=l.ps"); printf("/op

  • Using GCC on SunSolaris2.8 to compile and link sample OCI programsNovember 30

    Hi, Does anyone have sample make file (or modified version of demo_rdbms.mk) or command to compile and link OCI demo programs using gcc?? I am trying to compile and link cdemo81.c from rdbms/demo directory. gcc related files are under /usr/local/bin

  • Compile OCI program in Sun wrokshopNovember 30

    Hi, I am new to Sun workshop and Oracle OCI. How can I set up the environment to comipler Oracle OCI in Forte Sun workshop without using oracle make file? Thanks, Sherry<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote

  • How to call store procedure from an oci programNovember 30

    Hello, I work on Oracle 8.1.7 under AIX. I must call from an OCI C++ program a store procedure that have an result set as param out. I'm not sure how can I call the procedure/function. I want to execute this statement and fetch the results.: " CALL D

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 15 q. 0.974 s.