ocicolumnname

(PHP 3 >= 3.0.4, PHP 4, PHP 5)

ocicolumnname -- Liefert den Namen der Spalte zurück.

Beschreibung

string OCIColumnName ( int stmt, int col )

OCIColumnName() liefert den Name einer Spalte zurück passend zu der Spaltennummer (beginnend bei 1).

Beispiel 1. OCIColumnName

<?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>";
    }
    OCIFreeStatement($stmt);  
    OCILogoff($conn);   
    print "</PRE>";
    print "</HTML>\n"; 
?>

Bitte beachten Sie auch OCINumCols(), OCIColumnType(), und OCIColumnSize().

Hosting by: Hurra Communications GmbH
Generated: 2007-01-26 17:57:19