php-doc-en/reference/oci8/functions/ocicolumnsize.xml
2003-02-11 03:06:15 +00:00

86 lines
2.4 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.15 -->
<refentry id="function.ocicolumnsize">
<refnamediv>
<refname>ocicolumnsize</refname>
<refpurpose>Return result column size</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>ocicolumnsize</methodname>
<methodparam><type>int</type><parameter>stmt</parameter></methodparam>
<methodparam><type>mixed</type><parameter>column</parameter></methodparam>
</methodsynopsis>
<para>
<function>ocicolumnsize</function> returns the size of the column
as given by Oracle. You can either use
the column-number (1-Based) or the column-name for the
<parameter>column</parameter> parameter.
</para>
<para>
<example>
<title><function>ocicolumnsize</function> example</title>
<programlisting>
<![CDATA[
<?php
print "<HTML><PRE>\n";
$conn = OCILogon("scott", "tiger");
$stmt = OCIParse($conn,"select * from emp");
OCIExecute($stmt);
print "<TABLE BORDER=\"1\">";
print "<TR>";
print "<TH>Name</TH>";
print "<TH>Type</TH>";
print "<TH>Length</TH>";
print "</TR>";
$ncols = OCINumCols($stmt);
for ( $i = 1; $i <= $ncols; $i++ ) {
$column_name = OCIColumnName($stmt,$i);
$column_type = OCIColumnType($stmt,$i);
$column_size = OCIColumnSize($stmt,$i);
print "<TR>";
print "<TD>$column_name</TD>";
print "<TD>$column_type</TD>";
print "<TD>$column_size</TD>";
print "</TR>";
}
print "</TABLE>";
OCIFreeStatement($stmt);
OCILogoff($conn);
print "</PRE>";
print "</HTML>\n";
?>
]]>
</programlisting>
</example>
</para>
<simpara>
See also <function>ocinumcols</function>,
<function>ocicolumnname</function>, and
<function>ocicolumnsize</function>.
</simpara>
</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:"../../../../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
-->