Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 4860

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the module name</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.oci-set-edition.html">oci_set_edition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.oci-set-prefetch.html">oci_set_prefetch</a></div>
 <div class="up"><a href="ref.oci8.html">OCI8 Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.oci-set-module-name" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_set_module_name</h1>
  <p class="verinfo">(PHP 5.3.2, PECL OCI8 &gt;= 1.4.0)</p><p class="refpurpose"><span class="refname">oci_set_module_name</span> &mdash; <span class="dc-title">Sets the module name</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.oci-set-module-name-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>oci_set_module_name</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$module_name</code></span>
   )</div>

  <p class="para rdfs-comment">
   Sets the module name for Oracle tracing.
  </p>
  <p class="para">
   The module name is registered with the database when the next
   &#039;roundtrip&#039; from PHP to the database occurs, typically when an SQL
   statement is executed.
  </p>
  <p class="para">
   The name can subsequently be queried from database administration
   views such as <em>V$SESSION</em>.  It can be used for
   tracing and monitoring such as with <em>V$SQLAREA</em>
   and <em>DBMS_MONITOR.SERV_MOD_ACT_STAT_ENABLE</em>.
  </p>
  <p class="para">
   The value may be retained across persistent connections.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-set-module-name-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">connection</code></em></span>
     <dd>

      <p class="para">An Oracle connection identifier,
returned by  <span class="function"><a href="function.oci-connect.html" class="function">oci_connect()</a></span>,  <span class="function"><a href="function.oci-pconnect.html" class="function">oci_pconnect()</a></span>,
or  <span class="function"><a href="function.oci-new-connect.html" class="function">oci_new_connect()</a></span>.</p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">module_name</code></em></span>
     <dd>

      <p class="para">
       User chosen <span class="type"><a href="language.types.string.html" class="type string">string</a></span> up to 48 bytes long.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-set-module-name-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.oci-set-module-name-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <strong>Oracle version requirement</strong><br />
<p class="para">This function is available when PHP is linked with Oracle Database
libraries from version 10<em class="emphasis">g</em> onwards.</p></p></blockquote>
  <div class="tip"><strong class="tip">Tip</strong><h1 class="title">Performance</h1><p class="para">With older versions of
OCI8 or the Oracle Database, the client information can be set using the Oracle
<em>DBMS_APPLICATION_INFO</em> package. This is less efficient than
using  <span class="function"><a href="function.oci-set-client-info.html" class="function">oci_set_client_info()</a></span>.</p></div>
  <div class="caution"><strong class="caution">Caution</strong><h1 class="title">Roundtrip Gotcha</h1>
<p class="para">Some but not all OCI8 functions cause roundtrips.  Roundtrips to the
database may not occur with queries when result caching is enabled.
</p></div>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-set-module-name-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-2026">
    <p><strong>Example #1 Setting the module name</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$c&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">oci_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'hr'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'welcome'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'localhost/XE'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Record&nbsp;the&nbsp;module<br /></span><span style="color: #0000BB">oci_set_module_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Home&nbsp;Page'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Code&nbsp;that&nbsp;causes&nbsp;a&nbsp;roundtrip,&nbsp;for&nbsp;example&nbsp;a&nbsp;query:<br /></span><span style="color: #0000BB">$s&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">oci_parse</span><span style="color: #007700">(</span><span style="color: #0000BB">$c</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'select&nbsp;*&nbsp;from&nbsp;dual'</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 /></span><span style="color: #0000BB">oci_fetch_all</span><span style="color: #007700">(</span><span style="color: #0000BB">$s</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">sleep</span><span style="color: #007700">(</span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents screen">
<div class="cdata"><pre>
// While the script is running, the administrator can see the
// modules in use:

sqlplus system/welcome
SQL&gt; select module from v$session;
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.oci-set-module-name-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.oci-set-action.html" class="function" rel="rdfs-seeAlso">oci_set_action()</a> - Sets the action name</span></li>
    <li class="member"> <span class="function"><a href="function.oci-set-client-info.html" class="function" rel="rdfs-seeAlso">oci_set_client_info()</a> - Sets the client information</span></li>
    <li class="member"> <span class="function"><a href="function.oci-set-client-identifier.html" class="function" rel="rdfs-seeAlso">oci_set_client_identifier()</a> - Sets the client identifier</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.oci-set-edition.html">oci_set_edition</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.oci-set-prefetch.html">oci_set_prefetch</a></div>
 <div class="up"><a href="ref.oci8.html">OCI8 Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>