PHP.nl

oci_set_edition

oci_set_edition

Sets the database edition

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 before calling , or . oci_set_edition``oci_connect``oci_pconnect``oci_new_connect

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

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

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

return.success

Voorbeeld: 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", $r, 20);
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", $r, 20);
oci_execute($s);
echo "The result is $r\n";

?>

Opmerking: > ### Oracle version requirement

This function is available from Oracle 11R2 onwards.

g

Let op: > ### Persistent connections

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

Let op: > ### DRCP Connection Pooling

To avoid inconsistencies and unexpected errors when using editions
and  with Oracle
11.2.0.1, keep a one-to-one correspondence between
the 
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.

DRCPoci8.connection_class