<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.oci-field-type.php',
    1 => 'oci_field_type',
    2 => 'Retourne le type de donn&eacute;es d\'un champ Oracle',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'Fonctions OCI8',
  ),
  'prev' => 
  array (
    0 => 'function.oci-field-size.php',
    1 => 'oci_field_size',
  ),
  'next' => 
  array (
    0 => 'function.oci-field-type-raw.php',
    1 => 'oci_field_type_raw',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/oci8/functions/oci-field-type.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.oci-field-type" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">oci_field_type</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8, PECL OCI8 &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">oci_field_type</span> &mdash; <span class="dc-title">Retourne le type de données d&#039;un champ Oracle</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.oci-field-type-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>oci_field_type</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$statement</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$column</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Retourne le nom du type de données d&#039;un champ.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-field-type-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">statement</code></dt>
     <dd>
      <p class="para">
       Un identifiant de requête OCI valide.
      </p>
     </dd>
    
    
     <dt><code class="parameter">column</code></dt>
     <dd>
      <p class="para">
       Peut être l&#039;index du champ (l&#039;indexation commence à 1) ou le nom.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-field-type-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne le type de données d&#039;un champ, sous la forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a> ou d&#039;un
   <a href="language.types.integer.php" class="link">entier</a>, ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-field-type-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>oci_field_type()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">// Création de la table avec :<br />//   CREATE TABLE mytab (number_col NUMBER, varchar2_col varchar2(1), <br />//                       clob_col CLOB, date_col DATE);<br /><br />$conn = oci_connect("hr", "hrpwd", "localhost/XE");<br />if (!$conn) {<br />    $m = oci_error();<br />    trigger_error(htmlentities($m['message']), E_USER_ERROR);<br />}<br /><br />$stid = oci_parse($conn, "SELECT * FROM mytab");<br />oci_execute($stid, OCI_DESCRIBE_ONLY); // Utilisation de OCI_DESCRIBE_ONLY si aucune ligne n'est récupérée<br /><br />echo "&lt;table border=\"1\"&gt;\n";<br />echo "&lt;tr&gt;";<br />echo "&lt;th&gt;Name&lt;/th&gt;";<br />echo "&lt;th&gt;Type&lt;/th&gt;";<br />echo "&lt;th&gt;Length&lt;/th&gt;";<br />echo "&lt;/tr&gt;\n";<br /><br />$ncols = oci_num_fields($stid);<br /><br />for ($i = 1; $i &lt;= $ncols; $i++) {<br />    $column_name  = oci_field_name($stid, $i);<br />    $column_type  = oci_field_type($stid, $i);<br />    $column_size  = oci_field_size($stid, $i);<br /><br />    echo "&lt;tr&gt;";<br />    echo "&lt;td&gt;$column_name&lt;/td&gt;";<br />    echo "&lt;td&gt;$column_type&lt;/td&gt;";<br />    echo "&lt;td&gt;$column_size&lt;/td&gt;";<br />    echo "&lt;/tr&gt;\n";<br />}<br /><br />echo "&lt;/table&gt;\n";<br /><br />// Affiche :<br />//    Name           Type       Length<br />//    NUMBER_COL    NUMBER        22<br />//    VARCHAR2_COL  VARCHAR2       1<br />//    CLOB_COL      CLOB        4000<br />//    DATE_COL      DATE           7<br /><br />oci_free_statement($stid);<br />oci_close($conn);<br /><br />?&gt;</span></code></div>
    </div>

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


 <div class="refsect1 seealso" id="refsect1-function.oci-field-type-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.oci-num-fields.php" class="function" rel="rdfs-seeAlso">oci_num_fields()</a> - Retourne le nombre de colonnes dans un r&eacute;sultat Oracle</span></li>
    <li><span class="function"><a href="function.oci-field-name.php" class="function" rel="rdfs-seeAlso">oci_field_name()</a> - Retourne le nom d'un champ Oracle</span></li>
    <li><span class="function"><a href="function.oci-field-size.php" class="function" rel="rdfs-seeAlso">oci_field_size()</a> - Retourne la taille d'un champ Oracle</span></li>
   </ul>
  </p>
 </div>


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