Manuel PHP

Précédent

 

Suivant

OCIColumnSize

OCIColumnSize -- Retourne la taille de la colonne

Description

int OCIColumnSize(int 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>Nom</TH>";
    print "<TH>Type</TH>";
    print "<TH>Longueur</TH>";
    Print "</TR>";
    $ncols = OCINumCols($stmt);
    for ( $i = 1; $i <= $ncols; $i++ ) {
        $colonne_nom  = OCIColumnName($stmt,$i);
        $colonne_type  = OCIColumnType($stmt,$i);
        $colonne_taille  = OCIColumnSize($stmt,$i);
        print "<TR>";
        print "<TD>$colonne_nom</TD>";
        print "<TD>$colonne_type</TD>";
        print "<TD>$colonne_taille</TD>";
        print "</TR>";
    }
    OCIFreeStatement($stmt);  
    OCILogoff($conn);   
    Print "</PRE>";
    Print "</HTML>\n"; 
?>   

Voir aussi OCINumCols(), OCIColumnName(), et OCIColumnSize().

Précédent

Sommaire

Suivant

OCIColumnIsNULL

Chapitre

OCIServerVersion

Hébergé
par