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

Both sides previous revisionPrevious revision
Next revision
Previous revision
dictionary:dropcolumnsql [2015/08/29 18:30] 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','ACTNOTES'); $sqlarray = $dict->dropColumnSql('ACT','ACTNOTES');
Line 22: Line 25:
 print_r($sqlarray); print_r($sqlarray);
  
 +/*
 + * Prints
 Array Array
 ( (
     [0] => ALTER TABLE ACT DROP COLUMN ACTNOTES     [0] => ALTER TABLE ACT DROP COLUMN ACTNOTES
 ) )
 +
 +*/
 +
 +$dict->executeSqlArray($executeSqlArray);
 +
  
 </code> </code>
  
v5/dictionary/dropcolumnsql.1440865819.txt.gz · Last modified: 2017/04/21 11:28 (external edit)