0 Replies Latest reply on Feb 12, 2013 3:23 PM by 949968

    Need details on usage of "createStatement" of OCCI, for less parse calls

      Hi All,

      I am working on CPP code where i am using OCCI for connecting to database and perform actions like INSERT, UPDATE, DELETE etc. on different tables (which includes huge tables which contain millions of records).
      I have requested for AWR report from our DBA and during its analysis, i found that, number of "parse calls" for UPDATE and INSERT on two tables is too high.

      As part of code, what i am doing is to call a function called Updatetable, where i define Updatetable function as below:
      int Cdb::updatetable()
      Statement *stmt = conn->createStatement (" UPDATE table set data1 =:1 where data2 =:2");
      stmt->setInt(1, data1);
      stmt->setInt(2, data2);
      updateCnt = stmt->executeUpdate();
      return updateCnt;

      This function is called, once per "Oracle queue message" and which means, if i have 2000 messages, it will be called for 2000 times. Also gets parsed by 2000 times.

      I have tried to reduce parse counts, by declaring and defining "createStatement" outside this function, but end up with "Segmentation fault".

      So, please let me know if there is any other way to get the parse calls reduced.

      Thanks in Advance!