Description
int
ocicolumnsize ( resource stmt, mixed column)
ocicolumnsize() retourne la taille de la colonne.
Vous pouvez utiliser l'index de colonne (l'indexation commence
à 1) ou le nom de la colonne dans le paramètre
col.
Exemple 1. ociColumnSize <?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";
?> |
|
Voir aussi
ocinumcols(),
ocicolumnname() et
ocicolumnsize().