Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » DDL Statements » ALTER TABLE |
ALTER TABLE <Name> [ADD [COLUMN] <ColumnName> <ColumnDefinition>] [ALTER [COLUMN] <ColumnName> <ColumnAlterOptions>|AS <ColumnDefinition> [RENAME [COLUMN] <ColumnName> TO <ColumnName>] [DROP [COLUMN] <ColumnName>] [ADD [CONSTRAINT <ConstraintName>] <ConstraintDefinition>] [ALTER CONSTRAINT <ConstraintName> <ConstraintAlterOptions>|AS <ConstraintDefinition> [RENAME CONSTRAINT <ConstraintName> TO <ConstraintName> [DROP CONSTRAINT <ConstraintName>] [,ADD|ALTER|DROP] [DESCRIPTION <Description>] [VERSION <VersionNumber>] [READONLY|READWRITE] [ENCRYPTED|UNENCRYPTED] [INDEX PAGE SIZE <IndexPageSize>] [BLOB BLOCK SIZE <BLOBBlockSize>] [PUBLISH BLOCK SIZE <PublishBlockSize>] [PUBLISH COMPREESSION <Compression>] [MAX ROW BUFFER SIZE <MaxRowBufferSize>] [MAX INDEX BUFFER SIZE <MaxIndexBufferSize>] [MAX BLOB BUFFER SIZE <MaxBLOBBufferSize>] [MAX PUBLISH BUFFER SIZE <MaxPublishBufferSize>] [ATTRIBUTES <CustomAttributes>] [NO BACKUP FILES] <ColumnDefinition> = <DataType> [COMPRESSION <Compression>] [GENERATED <GenerationOptions>|COMPUTED <ComputationOptions>| DEFAULT <DefaultExpression>] [<ColumnConstraintDefinition>] [<ColumnConstraintDefinition>] [NOT NULL [ERROR CODE <ErrorCode> MESSAGE <ErrorMessage>]] [<ColumnConstraintDefinition>] [<ColumnConstraintDefinition>] [DESCRIPTION <Description>] [AT <ColumnPos>] <ErrorCode> = Any user-defined (10000-High(INTEGER)) error code <DataType> = CHARACTER|CHAR [(<Length>]) [<CollationName>] CHARACTER VARYING|VARCHAR [(<Length>]) [<CollationName>] GUID BYTE [(<LengthInBytes>]) BYTE VARYING|VARBYTE [(<LengthInBytes>]) BINARY LARGE OBJECT|BLOB CHARACTER LARGE OBJECT|CLOB [<CollationName>] BOOLEAN|BOOL SMALLINT INTEGER|INT BIGINT FLOAT [(<Precision>,<Scale>)] DECIMAL|NUMERIC [(<Precision>,<Scale>)] DATE TIME TIMESTAMP INTERVAL YEAR [TO MONTH] INTERVAL MONTH INTERVAL DAY [TO HOUR|MINUTE|SECOND|MSECOND] INTERVAL HOUR [TO MINUTE|SECOND|MSECOND] INTERVAL MINUTE [TO SECOND|MSECOND] INTERVAL SECOND [TO MSECOND] INTERVAL MSECOND <Compression> = 0..9 <GenerationOptions> = ALWAYS AS <GenerateExpression>| ALWAYS AS IDENTITY (START WITH <SeedValue>, INCREMENT BY <IncrementValue>)| BY DEFAULT AS IDENTITY (START WITH <SeedValue>, INCREMENT BY <IncrementValue>) <GenerateExpression> = Any valid SQL expression that does not include any sub-queries <ComputationOptions> = ALWAYS AS <ComputeExpression> <ComputeExpression> = Any valid SQL expression that does not include any sub-queries or user-defined function references <DefaultExpression> = Any valid SQL expression that does not include any sub-queries <ColumnConstraintDefinition> = CHECK <CheckExpression> PRIMARY KEY| UNIQUE| REFERENCES <TableName> [(<ColumnName> [,<ColumnName>])] [ON UPDATE RESTRICT|ON DELETE RESTRICT] [ERROR CODE <ErrorCode> MESSAGE <ErrorMessage>] <CheckExpression> = Any valid SQL expression that does not include any sub-queries <ErrorCode> = Any user-defined (10000-High(INTEGER)) error code <ColumnAlterOptions> = [SET <DefaultExpression>|DROP DEFAULT|DESCRIPTION <Description>| MOVE TO <ColumnPos>|RESTART WITH <SeedValue>] <ConstraintDefinition> = CHECK <CheckExpression> PRIMARY KEY (<ColumnName> [,<ColumnName>])| UNIQUE (<ColumnName> [,<ColumnName>])| FOREIGN KEY (<ColumnName> [,<ColumnName>]) REFERENCES <TableName> [(<ColumnName> [,<ColumnName>])] [ON UPDATE RESTRICT|ON DELETE RESTRICT] [ERROR CODE <ErrorCode> MESSAGE <ErrorMessage>] [DESCRIPTION <Description>] <CheckExpression> = Any valid SQL expression that does not include any sub-queries <ErrorCode> = Any user-defined (10000-High(INTEGER)) error code <ConstraintAlterOptions> = [DESCRIPTION <Description>]
-- The following statement alters the structure of the -- Customer table by adding a new Notes column. ALTER TABLE "Customer" ADD COLUMN Notes CLOB -- The following statement alters the structure of the -- Customer table by adding a new foreign key constraint -- on the State column that establishes a referential -- integrity link to the State table. ALTER TABLE "Customer" ADD CONSTRAINT "State_ForeignKey" FOREIGN KEY REFERENCES "State" -- The following statement alters the structure of the -- Customer table by renaming the State column to StateProvince. ALTER TABLE "Customer" RENAME COLUMN State TO StateProvince
Deviation | Details |
Column AS | The AS column alteration clause is an ElevateDB extension. |
Column COMPUTED | The column COMPUTED clause is an ElevateDB extension. |
Column ERROR CODE/MESSAGE | The column ERROR CODE/MESSAGE clause is an ElevateDB extension. |
Column DESCRIPTION | The column DESCRIPTION and SET DESCRIPTION clauses are ElevateDB extensions. |
Column COMPRESSION | The column COMPRESSION clause is an ElevateDB extension. |
Column AT | The column AT clause for adding columns at a specific position is an ElevateDB extension. |
Column MOVE TO | The column MOVE TO clause for altering columns and moving them to a specific position is an ElevateDB extension. |
RENAME COLUMN | The RENAME COLUMN clause is an ElevateDB extension. |
Constraint AS | The AS constraint alteration clause is an ElevateDB extension. |
Constraint ON UPDATE | The only option supported for the ON UPDATE clause is the RESTRICT option. |
Constraint ON DELETE | The only option supported for the ON DELETE clause is the RESTRICT option. |
Constraint ERROR CODE/MESSAGE | The constraint ERROR CODE/MESSAGE clause is an ElevateDB extension. |
Constraint DESCRIPTION | The constraint DESCRIPTION and SET DESCRIPTION clauses are ElevateDB extensions. |
RENAME CONSTRAINT | The RENAME CONSTRAINT clause is an ElevateDB extension. |
DESCRIPTION | The DESCRIPTION clause is an ElevateDB extension. |
VERSION | The VERSION clause is an ElevateDB extension. |
ENCRYPTED | The ENCRYPTED and UNENCRYPTED clauses are an ElevateDB extension. |
INDEX PAGE SIZE | The INDEX PAGE SIZE clause is an ElevateDB extension. |
BLOB BLOCK SIZE | The BLOB BLOCK SIZE clause is an ElevateDB extension. |
PUBLISH BLOCK SIZE | The PUBLISH BLOCK SIZE clause is an ElevateDB extension. |
PUBLISH COMPRESSION | The PUBLISH COMPRESSION clause is an ElevateDB extension. |
MAX ROW BUFFER SIZE | The MAX ROW BUFFER SIZE clause is an ElevateDB extension. |
MAX INDEX BUFFER SIZE | The MAX INDEX BUFFER SIZE clause is an ElevateDB extension. |
MAX BLOB BUFFER SIZE | The MAX BLOB BUFFER SIZE clause is an ElevateDB extension. |
MAX PUBLISH BUFFER SIZE | The MAX PUBLISH BUFFER SIZE clause is an ElevateDB extension. |
ATTRIBUTES | The ATTRIBUTES clause is an ElevateDB extension. |
NO BACKUP FILES | The NO BACKUP FILES clause is an ElevateDB extension. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |