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

# metaTables

##### Syntax

    string[] metaTables(
      optional string $tableType=false,
      optional bool $showSchema=false
      optional string $mask=false,
      optional string $schemaMask=false
      )

## Description

The function `metaTables()` returns a list of tables and views in the currently attached database. The function does not return system tables.

## Parameters

### $tableType

There are 2 available options to this parameter:

Option | Description
--- | ---
TABLES | Only show tables in current schema
VIEWS | Only show views in current schema

Many databases support 'T' and 'V' as these options

Support for this option is limited to the IBM DB2 driver

### $showSchema

This parameter attaches the schema name to the table

Support for this option is limited. Check the database driver documentation.

### $mask

This option define a mask for matching tables . For example, setting $mask = 'TMP%' will match all tables that begin with 'TMP'.

Support for this option is limited to the deprecated ODBC driver for IBM and may be removed in future releases . Check the database driver documentation.

### $schemaMask

This option define a mask for matching schemas . For example, setting $mask = 'SYS%' will match all schemas that begin with 'SYS'.

## Usage

    /*
     * Assume connection to DB2 database 'sample'
     */

    $ar = $db->metaTables('TABLES');
    /*
     * $ar returns:
      [0] => DEPT
      [1] => EMP
      [2] => EMPACT
      [3] => EMP_ACT
      [4] => PROJ
      [5] => ADEFUSR
      ......

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

### Page Tools

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