Rechercher une fonction PHP

oci_set_edition

(PHP 5 >= 5.3.2, PHP 7, PECL OCI8 >= 1.4.0)

oci_set_editionSets the database edition

Description

oci_set_edition ( string $edition ) : bool

Sets the database "edition" of objects to be used by a subsequent connections.

Oracle Editions allow concurrent versions of applications to run using the same schema and object names. This is useful for upgrading live systems.

Call oci_set_edition() before calling oci_connect(), oci_pconnect() or oci_new_connect().

If an edition is set that is not valid in the database, connection will fail even if oci_set_edition() returns success.

When using persistent connections, if a connection with the requested edition setting already exists, it is reused. Otherwise, a different persistent connection is created

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

Parameters

edition

Oracle Database edition name previously created with the SQL "CREATE EDITION" command.

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

Notes

Note: Oracle version requirement

This function is available from Oracle 11gR2 onwards.

Caution

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

Persistent connections

To avoid inconsistencies and unexpected errors, do not use ALTER SESSION SET EDITION to change the edition on persistent connections.

Caution

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

DRCP Connection Pooling

To avoid inconsistencies and unexpected errors when using editions and DRCP with Oracle 11.2.0.1, keep a one-to-one correspondence between the oci8.connection_class and the edition name used by applications. Each pooled server of a given connection class should only be used with one edition. This restriction has been removed with Oracle 11.2.0.2.

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

Return Values

Returns TRUE on success or FALSE on failure.

PHP: oci_set_edition - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 Two scripts can use different versions of myfunc() at the same time

<?php

// File 1

echo "Version 1 of application\n";

oci_set_edition('ORA$BASE');
$c oci_connect('hr''welcome''localhost/XE');

$s oci_parse($c"begin :r := myfunc(); end;");
oci_bind_by_name($s":r"$r20);
oci_execute($s);
echo 
"The result is $r\n";

?>
<?php

// File 2

echo "Version 2 of application\n";

oci_set_edition('E1');
$c oci_connect('hr''welcome''localhost/XE');

$s oci_parse($c"begin :r := myfunc(); end;");
oci_bind_by_name($s":r"$r20);
oci_execute($s);
echo 
"The result is $r\n";

?>

Find a PHP function

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 30/01/2003, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/php-rf-function.oci-set-edition.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : http://php.net

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut