ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


Action unknown: siteexport_addpage
v5:dictionary:dropcolumnsql

dropColumnSql

See Also

Column Attributes Reference

Syntax
array dropColumnSql(
    string $tableName,
    string $columnName
    )

Description

The method dropColumnSql() creates the SQL statement necessary to drop an existing column given by $columnName from an existing table, given by ''$tableName'.

In order to actually create the column, the returned array must be passed to the executeSqlArray() method.

Usage

/*
* Connection to DB2 database
*/
$dict = NewDataDictionary($db);
$sqlarray = $dict->dropColumnSql('ACT','ACTNOTES');
 
print_r($sqlarray);
 
/*
 * Prints
Array
(
    [0] => ALTER TABLE ACT DROP COLUMN ACTNOTES
)
 
*/
 
$dict->executeSqlArray($executeSqlArray);
v5/dictionary/dropcolumnsql.txt · Last modified: 2016/01/13 02:06 by mnewnham