PHP.mk документација

oci_free_statement

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

function.oci-free-statement.php PHP.net прокси Преводот е вчитан
Оригинал на PHP.net
Патека function.oci-free-statement.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + преведен приказ Кодовите, табелите и белешките остануваат читливи во истиот тек.
oci_free_statement

Референца за `function.oci-free-statement.php` со подобрена типографија и навигација.

function.oci-free-statement.php

oci_free_statement

Класата OCICollection

oci_free_statementОслободува сите ресурси поврзани со изјава или курсор

= NULL

oci_free_statement(resource $statement): bool

Ослободува ресурси поврзани со курсорот или изјавата на Oracle, што беше добиен како резултат на oci_parse() или добиен од Oracle.

Параметри

statement

Валиден идентификатор на OCI изјава.

Вратени вредности

Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.

Белешки од корисници 3 белешки

Јен М.
пред 17 години
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 на instinctive dot it
пред 18 години
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.
passerbyxp на gmail dot com
пред 13 години
A freed statement is not "empty()", it's still a resource:

<?php
$con=oci_connect(/*connect*/);
$q=oci_parse($con,"SELECT sysdate FROM dual");
var_dump($q); // resource(5) of type (oci8 statement)
var_dump(empty($q)); // bool(false)
var_dump(oci_statement_type($q)); // string(6) "SELECT"
echo "------\n";
oci_execute($q);
var_dump($q); // same as above
var_dump(empty($q));
var_dump(oci_statement_type($q));
echo "------\n";
oci_free_statement($q);
var_dump($q); // resource(5) of type (Unknown)
var_dump(empty($q)); // bool(false)
var_dump(oci_statement_type($q)); // generates warning and returns false
oci_close($con);
?>

So far I can not think of a way to determine if a statement is freed without using an additional flag...
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.