mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 01:42:09 +01:00
122 lines
3.0 KiB
XML
122 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ed6de1ae20ce16c0c7be0b3fef282b6065bebfac Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.oci-num-fields" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>oci_num_fields</refname>
|
|
<refpurpose>Retourne le nombre de colonnes dans un résultat Oracle</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>oci_num_fields</methodname>
|
|
<methodparam><type>resource</type><parameter>statement</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Retourne le nombre de colonnes dans le résultat Oracle
|
|
<parameter>statement</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>statement</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un identifiant de requête OCI valide.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le nombre de colonnes, sous la forme d'un &integer;.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>oci_num_fields</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Création de la table avec :
|
|
// CREATE TABLE mytab (id NUMBER, quantity NUMBER);
|
|
|
|
$conn = oci_connect("hr", "hrpwd", "localhost/XE");
|
|
if (!$conn) {
|
|
$m = oci_error();
|
|
trigger_error(htmlentities($m['message']), E_USER_ERROR);
|
|
}
|
|
|
|
$stid = oci_parse($conn, "SELECT * FROM mytab");
|
|
oci_execute($stid, OCI_DESCRIBE_ONLY); // Utilisation de OCI_DESCRIBE_ONLY si aucune ligne n'est récupérée
|
|
|
|
$ncols = oci_num_fields($stid);
|
|
for ($i = 1; $i <= $ncols; $i++) {
|
|
echo oci_field_name($stid, $i) . " " . oci_field_type($stid, $i) . "<br>\n";
|
|
}
|
|
|
|
// Affiche :
|
|
// ID NUMBER
|
|
// QUANTITY NUMBER
|
|
|
|
oci_free_statement($stid);
|
|
oci_close($conn);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
Dans les versions de PHP antérieures à la version 5.0.0,
|
|
vous devez utiliser la fonction <function>ocinumcols</function>.
|
|
Cet ancien nom est toujours utilisable : un alias a été fait vers
|
|
la fonction <function>oci_num_fields</function>, pour assurer
|
|
la compatibilité ascendante. Toutefois, il est recommandé de ne
|
|
plus l'utiliser.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|