mirror of
https://github.com/php/pecl-database-ibm_db2.git
synced 2026-03-23 23:02:16 +01:00
38 lines
747 B
PHP
38 lines
747 B
PHP
--TEST--
|
|
IBM-DB2: db2_tables() - Play with table objects
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once('connection.inc');
|
|
|
|
$conn = db2_connect($database, $user, $password);
|
|
|
|
$result = db2_tables($conn, NULL, strtoupper($user), 'ANIM%');
|
|
|
|
while ($row = db2_fetch_object($result)) {
|
|
if (preg_match("/ANIME_CAT|ANIMALS/i",$row->TABLE_NAME)) {
|
|
echo 'Schema: ' . $row->TABLE_SCHEM . "\n";
|
|
echo 'Name: ' . $row->TABLE_NAME . "\n";
|
|
echo 'Type: ' . $row->TABLE_TYPE . "\n";
|
|
echo 'Remarks: ' . $row->REMARKS . "\n\n";
|
|
}
|
|
}
|
|
|
|
db2_free_result($result);
|
|
db2_close($conn);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Schema: %s
|
|
Name: ANIMALS
|
|
Type: TABLE
|
|
Remarks:
|
|
|
|
Schema: %s
|
|
Name: ANIME_CAT
|
|
Type: VIEW
|
|
Remarks:
|
|
|