downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

oci_set_module_name> <oci_set_client_info
Last updated: Fri, 20 Nov 2009

view this page in

oci_set_edition

(PHP 5.3.2, PECL OCI8 >= 1.4.0)

oci_set_editionSets the database edition

Description

bool oci_set_edition ( string $edition )

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

Parameters

edition

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

Notes

Note: Oracle version requirement
This function is available from Oracle 11gR2 onwards.

Caution

Persistent connections

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

Return Values

Returns TRUE on success or FALSE on failure.

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";

?>



add a note add a note User Contributed Notes
oci_set_edition
There are no user contributed notes for this page.

oci_set_module_name> <oci_set_client_info
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites