v5:dictionary:executesqlarray
executeSqlArray
Syntax
bool executeSqlArray ( array $sqlStatements )
Description
The method executeSqlArray()
executes an array of statements constructed by one of the data dictionary functions such as createTableSql(), dropIndexSql() or 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();
v5/dictionary/executesqlarray.txt · Last modified: 2016/01/13 02:06 by mnewnham