ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:droptablesql

dropTableSql

See Also

executeSqlArray()

Syntax
array dropTableSql (
    string $tableName
     )

Description

The method dropTableSql() creates the SQL statement necessary to drop an existing table in the database. In order to actualy drop the table, the output of the command must be executed with the executeSqlArray() method.

Parameters

$tableName

The table name must already exist in the database.

Usage

/*
* create a data dictionary object, using the database connection
*/
$dict = NewDataDictionary($db);
 
$tableName = "ACT";
 
/*
* create the SQL statement necessary to drop the table and its columns and indices
*/
$sqlarray = $dict->dropTableSql($tableName);
 
/*
 * This returns (for DB2)
Array
(
   [0] => DROP TABLE ACT
 
)
*/
 
/*
* This statement actually drops the table
*/
$dict->executeSqlArray($sqlarray);
v5/dictionary/droptablesql.txt · Last modified: 2016/01/13 02:06 by mnewnham