ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:dictionary:dropcolumnsql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dictionary:dropcolumnsql [2015/08/27 03:13] – created mnewnhamv5:dictionary:dropcolumnsql [2016/01/13 02:06] (current) – ↷ Links adapted because of a move operation mnewnham
Line 3: Line 3:
 <WRAP right box> <WRAP right box>
 == See Also == == See Also ==
-[[dictionary:column_attributes|Column Attributes Reference]] +[[v5:dictionary:column_attributes|Column Attributes Reference]] 
 == Syntax == == Syntax ==
   array dropColumnSql(   array dropColumnSql(
Line 13: Line 13:
 The method ''dropColumnSql()'' creates the SQL statement necessary to drop an existing column given by ''$columnName'' from an existing table, given by ''$tableName'. The method ''dropColumnSql()'' creates the SQL statement necessary to drop an existing column given by ''$columnName'' from an existing table, given by ''$tableName'.
  
-In order to actually create the column, the returned array must be passed to the [[dictionary:executeSqlArray|executeSqlArray()]] method. +In order to actually create the column, the returned array must be passed to the [[v5:dictionary:executesqlarray|executeSqlArray()]] method. 
  
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
 +/*
 +* Connection to DB2 database
 +*/
 $dict = NewDataDictionary($db); $dict = NewDataDictionary($db);
-$sqlarray = $dict->dropColumnSql('ACT','ACTDESC');+$sqlarray = $dict->dropColumnSql('ACT','ACTNOTES');
  
 print_r($sqlarray); print_r($sqlarray);
 +
 +/*
 + * Prints
 +Array
 +(
 +    [0] => ALTER TABLE ACT DROP COLUMN ACTNOTES
 +)
 +
 +*/
 +
 +$dict->executeSqlArray($executeSqlArray);
 +
  
 </code> </code>
  
v5/dictionary/dropcolumnsql.1440638025.txt.gz · Last modified: 2017/04/21 11:28 (external edit)