I just read your manual and have read that a OCI_Statement can be reused more
than once. I want to know if I understood well. Can I use the same object
OCI_Statement for different queries? I have to reset or to do somewhat
Thank you very much, really
Yours sincerely
Josemi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can reuse an OCI_Statement object as many times you want.
There no reset to do !
Any call to OCI_Prepare(), OCI_PrepareFmt(), OCI_ExecuteStmt() and
OCI_ExecuteStmtFtmt() internally reset the given statement handle and frees
its current resultset if any.
By example, you can do :
int main(void)
{
OCI_Connection *con;
OCI_Statement *st; if (!OCI_Initialize(error_handler, NULL, OCI_ENV_EVENTS)) return EXIT_FAILURE; con = OCI_ConnectionCreate("db", "test", "test", OCI_SESSION_DEFAULT); st = OCI_StatementCreate(con); OCI_ExecuteStmt(st, "select sysdate from dual"); /* ... code to retrieve data here ... */ OCI_ExecuteStmt(st, "select 1.2 from dual"); /* ... code to retrieve data here ... */ OCI_ExecuteStmt(st, "select 'toto from dual"); /* ... code to retrieve data here ... */ OCI_Prepare(st, "update john set salary = null"); OCI_Execute(st); /*... */
OCI_Commit(con);
OCI_StatementFree(st);
OCI_ConnectionFree(con);
OCI_Cleanup();
return EXIT_SUCCESS;
}
btw, how did you find the manual ?
Regards,
Vicnent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ah, now I understand you :-).
I think that your work is perfect, yes, really. I like very much your library
(well I think that you must use MFC, but I understand because you use standar
C). And your manual, is clear, with many examples. I liked much the difference
between to program with OCI and OCIlib, is clear.
Really, I'm grateful for your project.
Many thanks
Yours sincerely
Josemi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just read your manual and have read that a OCI_Statement can be reused more
than once. I want to know if I understood well. Can I use the same object
OCI_Statement for different queries? I have to reset or to do somewhat
Thank you very much, really
Yours sincerely
Josemi
Hi,
You can reuse an OCI_Statement object as many times you want.
There no reset to do !
Any call to OCI_Prepare(), OCI_PrepareFmt(), OCI_ExecuteStmt() and
OCI_ExecuteStmtFtmt() internally reset the given statement handle and frees
its current resultset if any.
By example, you can do :
btw, how did you find the manual ?
Regards,
Vicnent
Many thanks for your reply. Now I will to reprogram all :-)
I don't understand you :-(. I downloaded from http://sourceforge.net/projects
/orclib/files/OCILIB%20Sources/3.5.0/ocilib-3.5.0-user-guide.pdf/download. What's wrong? :-(
Regards,
Josemi
hi,
In fact, i didn't mean where did you find it but what did you think of it :)
Regards,
vincent
Ah, now I understand you :-).
I think that your work is perfect, yes, really. I like very much your library
(well I think that you must use MFC, but I understand because you use standar
C). And your manual, is clear, with many examples. I liked much the difference
between to program with OCI and OCIlib, is clear.
Really, I'm grateful for your project.
Many thanks
Yours sincerely
Josemi