<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.oci8.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.oci-set-edition.php',
    1 => 'oci_set_edition',
    2 => 'Sets the database edition',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'Функції OCI8',
  ),
  'prev' => 
  array (
    0 => 'function.oci-set-db-operation.php',
    1 => 'oci_set_db_operation',
  ),
  'next' => 
  array (
    0 => 'function.oci-set-module-name.php',
    1 => 'oci_set_module_name',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/oci8/functions/oci-set-edition.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.oci-set-edition" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_set_edition</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.2, PHP 7, PHP 8, PECL OCI8 &gt;= 1.4.0)</p><p class="refpurpose"><span class="refname">oci_set_edition</span> &mdash; <span class="dc-title">Sets the database edition</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.oci-set-edition-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>oci_set_edition</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$edition</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sets the database &quot;edition&quot; of objects to be used by a subsequent
   connections.
  </p>
  <p class="para">
   Oracle Editions allow concurrent versions of applications to run
   using the same schema and object names.  This is useful for
   upgrading live systems.
  </p>
  <p class="para">
   Call <span class="function"><strong>oci_set_edition()</strong></span> before calling
   <span class="function"><a href="function.oci-connect.php" class="function">oci_connect()</a></span>, <span class="function"><a href="function.oci-pconnect.php" class="function">oci_pconnect()</a></span>
   or <span class="function"><a href="function.oci-new-connect.php" class="function">oci_new_connect()</a></span>.
  </p>
  <p class="para">
   If an edition is set that is not valid in the database, connection
   will fail even if <span class="function"><strong>oci_set_edition()</strong></span> returns success.
  </p>
  <p class="para">
   When using persistent connections, if a connection with the
   requested edition setting already exists, it is reused.  Otherwise,
   a different persistent connection is created
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-set-edition-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">edition</code></dt>
     <dd>
      <p class="para">
       Oracle Database edition name previously created with the <abbr>SQL</abbr>
       &quot;<code class="literal">CREATE EDITION</code>&quot; command.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-set-edition-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-set-edition-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 Two scripts can use different versions of myfunc() at the same time</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// File 1<br /><br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"Version 1 of application\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">oci_set_edition</span><span style="color: #007700">(</span><span style="color: #DD0000">'ORA$BASE'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$c </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'hr'</span><span style="color: #007700">, </span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">, </span><span style="color: #DD0000">'localhost/XE'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$s </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">, </span><span style="color: #DD0000">"begin :r := myfunc(); end;"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_bind_by_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">, </span><span style="color: #DD0000">":r"</span><span style="color: #007700">, </span><span style="color: #0000BB">$r</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The result is </span><span style="color: #0000BB">$r</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
</div>


<div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// File 2<br /><br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"Version 2 of application\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">oci_set_edition</span><span style="color: #007700">(</span><span style="color: #DD0000">'E1'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$c </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'hr'</span><span style="color: #007700">, </span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">, </span><span style="color: #DD0000">'localhost/XE'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$s </span><span style="color: #007700">= </span><span style="color: #0000BB">oci_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">, </span><span style="color: #DD0000">"begin :r := myfunc(); end;"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_bind_by_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">, </span><span style="color: #DD0000">":r"</span><span style="color: #007700">, </span><span style="color: #0000BB">$r</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">oci_execute</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"The result is </span><span style="color: #0000BB">$r</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.oci-set-edition-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <strong>Oracle version requirement</strong><br />
   <p class="para">
    This function is available from Oracle 11<em>g</em>R2 onwards.
   </p>
  </p></blockquote>
  <div class="caution"><strong class="caution">Застереження</strong>
   <h1 class="title">Persistent connections</h1>
   <p class="para">
    To avoid inconsistencies and unexpected errors, do not use ALTER
    SESSION SET EDITION to change the edition on persistent connections.
   </p>
  </div>
  <div class="caution"><strong class="caution">Застереження</strong>
   <h1 class="title">DRCP Connection Pooling</h1>
   <p class="para">
    To avoid inconsistencies and unexpected errors when using editions
    and <a href="oci8.connection.php" class="link">DRCP</a> with Oracle
    11.2.0.1, keep a one-to-one correspondence between
    the <a href="oci8.configuration.php#ini.oci8.connection-class" class="link">oci8.connection_class</a>
    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.
   </p>
  </div>
 </div>


</div><?php manual_footer($setup); ?>