public interface AlterTableAlterStep<T>
ALTER TABLE
DSL used to ALTER
columns.
XYZ*Step
types directly from client code
It is usually not recommended to reference any XYZ*Step
types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step
types directly:
Modifier and Type | Method and Description |
---|---|
AlterTableFinalStep |
defaultValue(Field<T> expression)
Specify a new column
DEFAULT . |
AlterTableFinalStep |
defaultValue(T literal)
Specify a new column
DEFAULT . |
AlterTableFinalStep |
dropNotNull()
Make the column nullable.
|
AlterTableFinalStep |
set(DataType<?> type)
Specify a new column data type.
|
AlterTableFinalStep |
setNotNull()
Make the column
NOT NULL . |
@Support(value={ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,CUBRID,DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,MARIADB,MYSQL,ORACLE,POSTGRES,SQLITE,SQLSERVER,SYBASE}) AlterTableFinalStep defaultValue(T literal)
DEFAULT
.@Support(value={ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,CUBRID,DB2,DERBY,FIREBIRD,H2,HSQLDB,INGRES,MARIADB,MYSQL,ORACLE,POSTGRES,SQLITE,SQLSERVER,SYBASE}) AlterTableFinalStep defaultValue(Field<T> expression)
DEFAULT
.@Support(value={ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,CUBRID,DB2,DERBY,FIREBIRD,H2,HSQLDB,INFORMIX,INGRES,MARIADB,MYSQL,ORACLE,POSTGRES,SQLITE,SQLSERVER,SYBASE}) AlterTableFinalStep set(DataType<?> type)
This adds or removes NOT NULL
constraints on the column if
DataType.nullable()
is specified explicitly (not all databases
support this).
@Support(value={AURORA_POSTGRES,DB2,DERBY,H2,HSQLDB,POSTGRES}) AlterTableFinalStep setNotNull()
NOT NULL
.@Support(value={AURORA_POSTGRES,DB2,DERBY,H2,HSQLDB,POSTGRES}) AlterTableFinalStep dropNotNull()
Copyright © 2019. All rights reserved.