ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:settablecasing

setTableCasing

See Also

getTableCasing()

Syntax From ADOdb 6.0 *
void setTableCasing(
    int $caseOption
    )
    

* This feature is supported in the IBM DB2 driver from version 5.21.0

Description

setTableCasing() is a helper method that automatically converts any table name provided to a metaFunction to the specified case. This is mostly important to a DBMS where table names are case-sensitive. The method can be called multiple times during a program.

Options

The following options are available

ConstantValueDescription
TABLECASE_LOWER0Table names are converted to lower case
TABLECASE_UPPER1Table names are converted to upper case
TABLECASE_DEFAULT2No case conversion on input table names is performed

The default value is TABLECASE_DEFAULT.

Usage

/*
 * Connection to DB2 database assumed
*/
 
$db->setTableCasing($db::TABLECASE_UPPER);
$r = $db->metaColumnNames('Act');
/*
 * table casing automatically converts to 'ACT'
 *
 *returns 
 
Array(
[0] => ACTNO,
[1] => ACTDESC
)
*/
 
$db->setTableCasing($db::TABLECASE_LOWER);
$r = $db->metaColumnNames('Act');
/*
 * table casing automatically converts to 'act'
 *
 * because DB2 is case-sensitive, it returns 
 
Array(
)
*/
v5/dictionary/settablecasing.txt · Last modified: 2016/01/13 02:06 by mnewnham