|Oracle Call Interface Programmer's Guide
Release 2 (9.2)
Part Number A96584-01
More OCI Relational Functions, 7 of 106
This call prepares a SQL or PL/SQL statement for execution. The user has the option of using the statement cache, if it has been enabled.
sword OCIStmtPrepare2 ( OCISvcCtx *svchp, OCIStmt **stmthp, OCIError *errhp, CONST OraText *stmttext, ub4 stmt_len, CONST OraText *key, ub4 keylen, ub4 language, ub4 mode );
The service context to be associated with the statement.
A pointer to the error handle for diagnostics.
Pointer to the statement handle returned.
The statement text. The semantics of the
stmttext are same as that of OCIStmtPrepare, i.e, the string should be null-terminated.
The statement text length.
For statement caching only. The key to the returned statement in the cache. This can be used for future calls to
OCIStmtPrepare2(), in which case there is no need to pass in the statement text and related parameters. If the key is passed in, then the statement text and other parameters are ignored and the search is solely based on the key.
For statement caching only. The length of the key.
Specifies V7, or native syntax. Possible values are:
This function can be used with and without statement caching. This is determined at the time of connection or session pool creation. If caching is enabled for a session, then all statements in the session will have caching enabled, and if caching is not enabled, then all statements will not be cached.
The valid modes are:
stmthpwill be null. OCI_ERROR will be returned.