Query: sqlsrv_field_metadata
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SQLSRV_FIELD_METADATA(3) SQLSRV_FIELD_METADATA(3) sqlsrv_field_metadata - Retrieves metadata for the fields of a statement prepared bysqlsrv_prepare(3)orsqlsrv_query(3)SYNOPSISmixed sqlsrv_field_metadata (resource $stmt)DESCRIPTIONRetrieves metadata for the fields of a statement prepared by sqlsrv_prepare(3) or sqlsrv_query(3). sqlsrv_field_metadata(3) can be called on a statement before or after statement execution.PARAMETERSo $stmt - The statment resource for which metadata is returned.RETURN VALUESReturns an array of arrays is returned on success. Otherwise, FALSE is returned. Each returned array is described by the following table: Array returned by sqlsrv_field_metadata +----------+---------------------------------------------------+ | Key | | | | | | | Description | | | | +----------+---------------------------------------------------+ | Name | | | | | | | The name of the field. | | | | | Type | | | | | | | The numeric value for the SQL type. | | | | | Size | | | | | | | The number of characters for fields of character | | | type, the number of bytes for fields of binary | | | type, or NULL for other types. | | | | |Precision | | | | | | | The precision for types of variable precision, | | | NULL for other types. | | | | | Scale | | | | | | | The scale for types of variable scale, NULL for | | | other types. | | | | |Nullable | | | | | | | An enumeration indicating whether the column is | | | nullable, not nullable, or if it is not known. | | | | +----------+---------------------------------------------------+ For more information, see sqlsrv_field_metadata in the Microsoft SQLSRV documentation.EXAMPLESExample #1 sqlsrv_field_metadata(3) example <?php $serverName = "serverNamesqlexpress"; $connectionInfo = array( "Database"=>"AdventureWorks", "UID"=>"username", "PWD"=>"password"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { die( print_r( sqlsrv_errors(), true)); } $sql = "SELECT * FROM Table_1"; $stmt = sqlsrv_prepare( $conn, $sql ); foreach( sqlsrv_field_metadata( $stmt ) as $fieldMetadata ) { foreach( $fieldMetadata as $name => $value) { echo "$name: $value<br />"; } echo "<br />"; } ?>SEE ALSOsqlsrv_client_info(3). PHP Documentation Group SQLSRV_FIELD_METADATA(3)
Related Man Pages |
---|
sqlsrv_connect(3) - php |
sqlsrv_prepare(3) - php |
sqlsrv_fetch_array(3) - php |
sqlsrv_fetch_object(3) - php |
sqlsrv_field_metadata(3) - php |
Similar Topics in the Unix Linux Community |
---|
counter / increment problem within echo stmt |
Passing argumnets from shell script to sql |
case statement |
how to remove "^J" in a variable |
SQL output to UNIX variable |