(PHP 5, PHP 7, PECL OCI8 >= 1.1.0)
oci_field_size — 锟斤拷锟斤拷锟街段达拷小
oci_field_size()
锟斤拷锟街斤拷为锟斤拷位锟斤拷锟斤拷锟街段的达拷小锟斤拷field
锟斤拷锟斤拷锟斤拷值锟斤拷锟斤拷锟斤拷锟街段碉拷锟斤拷锟斤拷锟斤拷锟斤拷 1 锟斤拷始锟斤拷锟斤拷锟斤拷锟街讹拷锟斤拷锟斤拷
Example #1 oci_field_size()锟斤拷锟斤拷
<?php
$conn = oci_connect("scott", "tiger");
$stmt = oci_parse($conn, "SELECT * FROM emp");
oci_execute($stmt);
echo "<table border=\"1\">";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Type</th>";
echo "<th>Length</th>";
echo "</tr>";
$ncols = oci_num_fields($stmt);
for ($i = 1; $i <= $ncols; $i++) {
$column_name = oci_field_name($stmt, $i);
$column_type = oci_field_type($stmt, $i);
$column_size = oci_field_size($stmt, $i);
echo "<tr>";
echo "<td>$column_name</td>";
echo "<td>$column_type</td>";
echo "<td>$column_size</td>";
echo "</tr>";
}
echo "</table>";
oci_free_statement($stmt);
oci_close($conn);
?>
Note:
锟斤拷 PHP 5.0.0 之前锟侥版本锟斤拷锟斤拷使锟斤拷 ocicolumnsize() 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷煤锟斤拷锟斤拷锟斤拷锟饺伙拷锟斤拷茫锟轿拷锟斤拷录锟斤拷锟斤拷锟轿� oci_field_size() 锟侥憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟窖憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟狡硷拷使锟矫★拷
锟轿硷拷 oci_num_fields() 锟斤拷 oci_field_name()锟斤拷