ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:renametablesql

This is an old revision of the document!


dropTableSql

See Also

executeSqlArray()

Syntax
array dropTableSql (
    string $tableName,
     )

Description

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

Parameters

$tableName

The table name must not yet exist in the database. Names must conform to any database specific requirements such as length limitations and name casing.

Usage

/*
* create a data dictionary object, using the database connection
*/
$dict = NewDataDictionary($db);
 
$tabname = "ACT";
 
/*
* create the SQL statement necessary to drop the table and its columns
*/
$sqlarray = $dict->dropTableSql($tabname);
 
/*
 * This returns (for DB2)
Array
(
    [0] => DROP TABLE ACT
)
*/
 
/*
* This statement actually drops the table
*/
$dict->executeSqlArray($sqlarray);
v5/dictionary/renametablesql.1440636495.txt.gz · Last modified: 2017/04/21 11:27 (external edit)