PHP Doku:: Gibt alle verknüpften Ressourcen eines Statements oder Zeigers frei. - function.oci-free-statement.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenOracle OCI8OCI8 Funktionenoci_free_statement

Ein Service von Reinhard Neidl - Webprogrammierung.

OCI8 Funktionen

<<oci_field_type

oci_internal_debug>>

oci_free_statement

(PHP 5, PECL OCI8 >= 1.1.0)

oci_free_statement Gibt alle verknüpften Ressourcen eines Statements oder Zeigers frei.

Beschreibung

bool oci_free_statement ( resource $statement )

Bibt alle verknüpften Ressourcen eines Oracle-Statements oder -Zeigers frei, die durch das Ergebnis von oci_parse() zugewiesen oder von Oracle eingeholt wurden.

Parameter-Liste

statement

Ein gültiger Zeiger auf ein OCI-Statement.

Rückgabewerte

Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.


2 BenutzerBeiträge:
- Beiträge aktualisieren...
Jen M.
2.10.2008 20:05
oci_free_statement doesn't always free up cursors.  I had a query where I performed the following functions in a loop:

OCIParse
OCIExecute
Oci_fetch_assoc
(Grab some field values)
OciFreeStatement

I didn't specify the use of a cursor, but ran into a "maximum
open cursors exceeded" error.  Within my code, I had one "select * from table_with_lobs" query.  When I changed the query to be "select a, b, c, from table_with_lobs" (where I specified the actual column names and where those columns were not LOB fields) the error message went away and I didn't have to resort to upping the max_open_cursors value in Oracle.
rada at instinctive dot it
4.03.2008 17:46
If you are using cursors, make sure to free the statement *and* the cursor, especially if there is a possibility of running the proc/cursor again (e.g. with different parameters).

<?php

    oci_execute
($stmt);
   
oci_execute($crsr);

   
// iterate through cursor...
   
   
oci_free_statement($stmt);
   
oci_free_statement($crsr);
?>

You need to do it explicitly, closing connection for example does not seem to release the cursor.



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)