## org.h2.command.ddl
Class AlterTableAlterColumn

    java.lang.Object
      org.h2.command.Prepared
          org.h2.command.ddl.DefineCommand
              org.h2.command.ddl.SchemaCommand
                  org.h2.command.ddl.AlterTableAlterColumn

    public class AlterTableAlterColumn

extends SchemaCommand

This class represents the statements ALTER TABLE ADD, ALTER TABLE ALTER COLUMN, ALTER TABLE ALTER COLUMN RESTART, ALTER TABLE ALTER COLUMN SELECTIVITY, ALTER TABLE ALTER COLUMN SET DEFAULT, ALTER TABLE ALTER COLUMN SET NOT NULL, ALTER TABLE ALTER COLUMN SET NULL, ALTER TABLE DROP COLUMN

Field Summary
`static int` `ADD` The type of a ALTER TABLE ADD statement.
`static int` `CHANGE_TYPE` The type of a ALTER TABLE ALTER COLUMN statement that changes the column data type.
`static int` `DEFAULT` The type of a ALTER TABLE ALTER COLUMN SET DEFAULT statement.
`static int` `DROP` The type of a ALTER TABLE DROP COLUMN statement.
`static int` `NOT_NULL` The type of a ALTER TABLE ALTER COLUMN SET NOT NULL statement.
`static int` `NULL` The type of a ALTER TABLE ALTER COLUMN SET NULL statement.
`static int` `SELECTIVITY` The type of a ALTER TABLE ALTER COLUMN SELECTIVITY statement.

Fields inherited from class org.h2.command.Prepared
`headPos, parameters, prepareAlways, session, sqlStatement`

Constructor Summary
`AlterTableAlterColumn(Session session, Schema schema)`

Method Summary
`void` `setAddBefore(java.lang.String before)`
`void` `setDefaultExpression(Expression defaultExpression)`
`void` `setNewColumn(Column newColumn)`
`void` `setOldColumn(Column oldColumn)`
`void` `setSelectivity(Expression selectivity)`
`void` `setTable(Table table)`
`void` `setType(int type)`
`int` `update()` Execute the statement.

Methods inherited from class org.h2.command.ddl.SchemaCommand
`getSchema`

Methods inherited from class org.h2.command.ddl.DefineCommand
`isReadOnly, isTransactional, queryMeta`

Methods inherited from class org.h2.command.Prepared
`checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getPlanSQL, getSQL, getSQL, getSQL, isQuery, needRecompile, prepare, query, setCommand, setCurrentRowNumber, setHeadPos, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### NOT_NULL

    public static final int NOT_NULL

  The type of a ALTER TABLE ALTER COLUMN SET NOT NULL statement.

  See Also:
    Constant Field Values

### NULL

    public static final int NULL

  The type of a ALTER TABLE ALTER COLUMN SET NULL statement.

  See Also:
    Constant Field Values

### DEFAULT

    public static final int DEFAULT

  The type of a ALTER TABLE ALTER COLUMN SET DEFAULT statement.

  See Also:
    Constant Field Values

### CHANGE_TYPE

    public static final int CHANGE_TYPE

  The type of a ALTER TABLE ALTER COLUMN statement that changes the column data type.

  See Also:
    Constant Field Values

### ADD

    public static final int ADD

  The type of a ALTER TABLE ADD statement.

  See Also:
    Constant Field Values

### DROP

    public static final int DROP

  The type of a ALTER TABLE DROP COLUMN statement.

  See Also:
    Constant Field Values

### SELECTIVITY

    public static final int SELECTIVITY

  The type of a ALTER TABLE ALTER COLUMN SELECTIVITY statement.

  See Also:
    Constant Field Values

Constructor Detail

### AlterTableAlterColumn

    public AlterTableAlterColumn(Session session,
                                 Schema schema)

Method Detail

### setTable

    public void setTable(Table table)

### setOldColumn

    public void setOldColumn(Column oldColumn)

### setAddBefore

    public void setAddBefore(java.lang.String before)

### update

    public int update()
               throws java.sql.SQLException

  Description copied from class: `Prepared`
  Execute the statement.

  Overrides:
    `update` in class `Prepared`
  Returns:
    the update count
  Throws:
    `java.sql.SQLException` - if it is a query

### setType

    public void setType(int type)

### setSelectivity

    public void setSelectivity(Expression selectivity)

### setDefaultExpression

    public void setDefaultExpression(Expression defaultExpression)

### setNewColumn

    public void setNewColumn(Column newColumn)