oci_set_edition
(PHP 5.3.2, PECL OCI8 >= 1.4.0)
oci_set_edition — Sets the database edition
Description
$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.
Persistent connections
To avoid inconsistencies and unexpected errors, do not use ALTER SESSION SET EDITION to change the edition on persistent connections.
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.
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", $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";
?>
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- Oracle OCI8
- oci_bind_array_by_name
- oci_bind_by_name
- oci_cancel
- oci_client_version
- oci_close
- oci_commit
- oci_connect
- oci_define_by_name
- oci_error
- oci_execute
- oci_fetch_all
- oci_fetch_array
- oci_fetch_assoc
- oci_fetch_object
- oci_fetch_row
- oci_fetch
- oci_field_is_null
- oci_field_name
- oci_field_precision
- oci_field_scale
- oci_field_size
- oci_field_type_raw
- oci_field_type
- oci_free_descriptor
- oci_free_statement
- oci_get_implicit_resultset
- oci_internal_debug
- oci_lob_copy
- oci_lob_is_equal
- oci_new_collection
- oci_new_connect
- oci_new_cursor
- oci_new_descriptor
- oci_num_fields
- oci_num_rows
- oci_parse
- oci_password_change
- oci_pconnect
- oci_result
- oci_rollback
- oci_server_version
- oci_set_action
- oci_set_client_identifier
- oci_set_client_info
- oci_set_edition
- oci_set_module_name
- oci_set_prefetch
- oci_statement_type
Коментарии
404 Not Found