- 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:metaindexes

# metaIndexes

##### See Also

metaPrimaryKeys()
metaCasing

##### Syntax

      mixed metaIndexes(
          string $tableName,
          optional bool $includePrimary=false,
          optional string $owner=false,
          )

## Description

The function `metaIndexes()` returns a list of indexes associated with a specific table. If there are no indices defined for the requested table, the method returns false.

All drivers return the same array of data. There are no database-specific entries. The array of data is as followed:

    [index_name] => Array
            (
                [unique] => 0
                [columns] => Array
                    (
                        [0] => Column 1
                        [1] => Column 2
                        [2] => etc........
                    )
                 /*
                  * After ADOdb Version 6.0
                  * the following column is also returned
                  */
                 [primary] => 0
            )

As of ADOdb version 6.0, the casing of the index and column names can be controlled by the metaCasing setting.

The casing of metaIndexes is returned in the native mode for the database, you should not assume the casing for the returned data.

## Optional Parameters

### $includePrimary

If set, the index associated with the primary key is also returned

### $owner

If specified, only returns indexes associated with a table owned by that name. Support for this function is limited, see the compatibility matrix.

## Usage

    /*
     * Database connection to DB2 database sample assumed
     */
    $mi = $db->metaIndexes('ACT');
    print_r($mi);
    /*
     * Returns
    Array
    (
        [PK_ACT] => Array
            (
                [unique] => 0
                [columns] => Array
                    (
                        [0] => ACTNO
                    )

            )

        [XACT2] => Array
            (
                [unique] => 0
                [columns] => Array
                    (
                        [0] => ACTNO
                        [1] => ACTKWD
                    )

            )

    )
    */

v5/dictionary/metaindexes.txt · Last modified: 2016/01/12 17:06 by mnewnham

### Page Tools

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