| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Correct way to close OCI handles
Hi,
I have an OCI handle which I reuse for different SQL statements (for example)
checkerr(errhp, OCIStmtPrepare(stmthp, errhp, tempSQL,
(ub4) strlen((char *) tempSQL),
(ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
//check number of records updated
checkerr(errhp,
status = OCIStmtExecute(svchp, stmthp, errhp, (ub4) 1, (ub4) 0,
(CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
if(nrows!=1) //if have not updated the audit trail
printf("There was a problem updating the audit trail\n");
checkerr(errhp, OCIStmtPrepare(stmthp, errhp, tempSQLSysLog,
(ub4) strlen((char *) tempSQLSysLog),
(ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT));
//check number of records updated
checkerr(errhp,
status = OCIStmtExecute(svchp, stmthp, errhp, (ub4) 1, (ub4) 0,
(CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT);
if(nrows!=1) //if have not updated the audit trail
printf("There was a problem updating the system log\n");
Should I be "closing" the stmthp before reusing it?
Thanks,
John Received on Thu Oct 12 2000 - 12:38:19 CDT
![]() |
![]() |