org.axiondb.engine.commands
Class AlterTableCommand

java.lang.Object
  extended by org.axiondb.engine.commands.BaseAxionCommand
      extended by org.axiondb.engine.commands.AlterTableCommand
All Implemented Interfaces:
AxionCommand

public class AlterTableCommand
extends BaseAxionCommand

A Experimental: ALTER TABLE tableName

ADD column definition | DROP columnName command.

TODO: Suppoort child command so that constraint used along with ALTER ADD COLUMN can be handled.

TODO: Check for - Can't drop the last column

TODO: Support for ALTER TABLE ALTER COLUMN

TODO: This command already support renaming table, hookup the same with parser; ALTER TABLE RENAME TO

Version:
$Revision: 1.3 $ $Date: 2004/09/09 18:36:38 $

Constructor Summary
AlterTableCommand(String theTableName)
           
 
Method Summary
 void addColumn(String name, String datatypename, String precision, String scale, Selectable defaultValue)
           
 void dropColumn(String colName)
           
 boolean execute(Database db)
          Executes an SQL statement that may return multiple results.
 AxionResultSet executeQuery(Database database)
          Unsupported
 int executeUpdate(Database db)
          Executes an SQL that may add, delete or modify zero or more rows within the database, such as an INSERT, UPDATE or DELETE statement.
 
Methods inherited from class org.axiondb.engine.commands.BaseAxionCommand
appendBindVariables, assertNotReadOnly, attemptToConvertValue, bind, clearBindings, getBindVariableIterator, getEffectedRowCount, getResultSet, getRowIterator, getRowIterator, getTableForIdentifier, resolveSelectableList, resolveSelectableList, setEffectedRowCount, setResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlterTableCommand

public AlterTableCommand(String theTableName)
Method Detail

addColumn

public void addColumn(String name,
                      String datatypename,
                      String precision,
                      String scale,
                      Selectable defaultValue)

dropColumn

public void dropColumn(String colName)

execute

public boolean execute(Database db)
                throws AxionException
Description copied from interface: AxionCommand
Executes an SQL statement that may return multiple results.

Returns:
true if one or more ResultSets were generated, false otherwise
Throws:
AxionException
See Also:
Statement.execute(java.lang.String), PreparedStatement.execute()

executeQuery

public AxionResultSet executeQuery(Database database)
                            throws AxionException
Unsupported

Returns:
the generated ResultSet
Throws:
AxionException
See Also:
Statement.executeQuery(java.lang.String), PreparedStatement.executeQuery()

executeUpdate

public int executeUpdate(Database db)
                  throws AxionException
Description copied from interface: AxionCommand
Executes an SQL that may add, delete or modify zero or more rows within the database, such as an INSERT, UPDATE or DELETE statement. In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed via this method.

Returns:
the number of rows modified
Throws:
AxionException
See Also:
Statement.executeUpdate(java.lang.String), PreparedStatement.executeUpdate()