ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


reference:metatables

This is an old revision of the document!


metaTables

Syntax
string[] metaTables(
  optional string $tableType=false,
  optional bool $showSchema=false
  optional string $mask=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:

OptionDescription
TABLESOnly show tables in current schema
VIEWSOnly show views in current schema

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


$showSchema

Support for this option is limited to the IBM DB2 driver

This parameter attaches the schema name to the table


$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. Check the database driver documentation.

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
  ......
reference/metatables.1437578494.txt.gz ยท Last modified: (external edit)