- skip to content

# Database Abstraction Layer

### User Tools

- Login

### Site Tools

- Recent changes
- Media Manager
- Sitemap

### Sidebar

##### Resources

- Reference Manual
- User Guide
- The Data Dictionary
- ADOdb-xmlschema
- ADOdb Active Record
- Performance Monitoring
- Date/Time Library
- Session Management Library
- Unsupported Addons
- Coding Standards

##### Supported Databases

- Access
- ADO
- CSV
- Firebird
- Frontbase
- IBM DB2
- Informix
- Interbase
- LDAP
- Microsoft SQL Server
- MySQL
- Netezza
- ODBC
- ODBTP
- Oracle
- PDO
- Postgresql
- SAP ADS
- SAP ASE
- SAP Maxdb
- SAP Sqlanywhere
- Sqlite
- Sybase
- Plain Text
- Visual Foxpro

##### Other

- Feature Comparison Matrix
- Connection Matrix
- Include File Guide

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/12 17:06 by mnewnham

### Page Tools

- Show pagesource
- Old revisions
- Backlinks
- Rename Page
- Back to top