====== executeSqlArray ======
~~NOTOC~~
== Syntax ==
bool executeSqlArray (
array $sqlStatements
)
===== Description =====
The method ''executeSqlArray()'' executes an array of statements constructed by one of the data dictionary functions such as [[v5:dictionary:createtablesql|createTableSql()]], [[v5:dictionary:dropindexsql|dropIndexSql()]] or [[v5:dictionary:addcolumnsql|addColumnSql()]].
The statements are executed within the scope of a single transaction.
===== Usage =====
/*
* create a data dictionary object, using the database connection
*/
$dict = NewDataDictionary($db);
$tabname = "LCTABLE";
/*
* Change the length of COL1 from 32 chars to 60
*/
$flds = "
COL1 C(60) NOTNULL DEFAULT 'abc',
";
/*
* create the SQL statement necessary to modify the column
*/
$sqlarray = $dict->changeTableSQL($tabname, $flds);
/*
* This statement actually changes the table
*/
$db->startTrans();
$dict->executeSqlArray($sqlarray);
$db->completeTrans();