====== releaseStatement ======
~~NOTOC~~
Support for this function is limited; it is currently only implemented in the [[v5:database:oracle|oci8]] driver.
See the [[v5:database:feature_comparison]].
== See Also ==
[[v5:reference:connection:prepare]]
== Syntax ==
bool releaseStatement (
mixed $stmt
)
===== Description =====
The ''releaseStatement()'' method releases a previously prepared statement, freeing all associated database server resources.
With the oci8 driver, this helps avoiding //ORA-01000: maximum open cursors exceeded// errors when the prepare() statement is used in a loop (see [[https://github.com/ADOdb/ADOdb/issues/770|issue #770]]).
Available since ADOdb 5.22.0.
==== Parameters ====
* $stmt A statement resource, as returned by [[v5:reference:connection:prepare|prepare()]]
==== Returns ====
//True// if the statement was successfully released, //false// otherwise.
-------------------------------------
===== Usage =====
/*
* Connection to Oracle database
*/
$stmt = $db->prepare('INSERT INTO table (field1, field2) VALUES (:p1, :p2)');
$rs = $db->execute($stmt, ['pf1' => 'Value1', 'pf2' => 'Value2']);
$db->releaseStatement($stmt);