- skip to content

# Database Abstraction Layer

### User Tools

- Login

### Site Tools

- Recent changes
- Media Manager
- Sitemap

### Sidebar

##### Resources

- Reference Manual
- User Guide
- The Data Dictionary
- ADOdb-xmlschema
- ADOdb Active Record
- Performance Monitoring
- Date/Time Library
- Session Management Library
- Unsupported Addons
- Coding Standards

##### Supported Databases

- Access
- ADO
- CSV
- Firebird
- Frontbase
- IBM DB2
- Informix
- Interbase
- LDAP
- Microsoft SQL Server
- MySQL
- Netezza
- ODBC
- ODBTP
- Oracle
- PDO
- Postgresql
- SAP ADS
- SAP ASE
- SAP Maxdb
- SAP Sqlanywhere
- Sqlite
- Sybase
- Plain Text
- Visual Foxpro

##### Other

- Feature Comparison Matrix
- Connection Matrix
- Include File Guide

v5:dictionary:metacolumns

# metaColumns

    obj[] metaColumns(
         string $tableName,
         optional bool $normalize=false
         )

## Description

The function `metaColumns()` returns an array of adofieldobject objects, each representing a description of each field of the requested table or view in the passed value `$tableName`. Each database returns a core set of descriptions, plus additional information. See the driver documentation for more information.

The formatting of the array cannot be controlled by `ADODB_ASSOC_CASE`, the following casing occurs:

- Field name (array key) - if the current value of adodb_fetch_mode is ADODB_FETCH_NUM, then the keys are returned as a numeric array, otherwise they are returned as an Upper Case key containing the name of the field.
- Information keys - Lower Case
- Information - Lower Case

## Usage

    /*
     * Assume DB2 connection
     */
    $ar = $db->MetaColumns('ACT');
    print_r($ar);
    /*
     * Returns
    Array
    (
        [ACTNO] => ADOFieldObject Object
            (
                [name] => ACTNO
                [max_length] => 2
                [type] => I
                [not_null] =>
                [scale] => 0
                [primary_key] => 1
            )

        [ACTKWD] => ADOFieldObject Object
            (
                [name] => ACTKWD
                [max_length] => 6
                [type] => C
                [not_null] =>
                [scale] =>
                [primary_key] =>
            )

        [ACTDESC] => ADOFieldObject Object
            (
                [name] => ACTDESC
                [max_length] => 20
                [type] => C
                [not_null] =>
                [scale] =>
                [primary_key] =>
            )

    )
    */

v5/dictionary/metacolumns.txt · Last modified: 2016/01/19 04:21 by 66.249.75.217

### Page Tools

- Show pagesource
- Old revisions
- Backlinks
- Rename Page
- Back to top