<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.oci-field-type.php',
    1 => 'oci_field_type',
    2 => 'Devuelve el tipo de datos de un campo Oracle',
  ),
  'up' => 
  array (
    0 => 'ref.oci8.php',
    1 => 'Funciones de 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' => 'es',
    '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">Devuelve el tipo de datos de un campo Oracle</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.oci-field-type-description">
  <h3 class="title">Descripción</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">
   Devuelve el nombre del tipo de datos de un campo.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.oci-field-type-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">statement</code></dt>
     <dd>
      <p class="para">
       Un identificador de consulta OCI válido.
      </p>
     </dd>
    
    
     <dt><code class="parameter">column</code></dt>
     <dd>
      <p class="para">
       Puede ser el índice del campo (la indexación comienza en 1) o el nombre.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.oci-field-type-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Devuelve el tipo de datos de un campo, en forma de <span class="type"><a href="language.types.string.php" class="type string">string</a></span> o un
   <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>, o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si ocurre un error
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.oci-field-type-examples">
  <h3 class="title">Ejemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Ejemplo #1 Ejemplo con <span class="function"><strong>oci_field_type()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">// Creación de la tabla con:<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); // Uso de OCI_DESCRIBE_ONLY si no se recupera ninguna fila<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 />// Muestra:<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">Ver también</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> - Devuelve el n&uacute;mero de columnas en un resultado Oracle</span></li>
    <li><span class="function"><a href="function.oci-field-name.php" class="function" rel="rdfs-seeAlso">oci_field_name()</a> - Devuelve el nombre de un campo Oracle</span></li>
    <li><span class="function"><a href="function.oci-field-size.php" class="function" rel="rdfs-seeAlso">oci_field_size()</a> - Devuelve el tama&ntilde;o de un campo Oracle</span></li>
   </ul>
  </p>
 </div>


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