Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateDDL statements → ALTER TABLE
Firebird Home Firebird Home Prev: DDL statementsFirebird Documentation IndexUp: DDL statementsNext: ALTER TRIGGER

ALTER TABLE

ALTER COLUMN: POSITION now 1-based
UNIQUE constraints now allow NULLs
USING INDEX subclause

Available in: DSQL, ESQL

ALTER COLUMN: POSITION now 1-based

Changed in: 1.0

Description: When changing a column's position, the engine now interprets the new position as 1-based. This is in accordance with the SQL standard and the InterBase documentation, but in practice InterBase interpreted the position as 0-based.

Syntax: 

ALTER TABLE tablename ALTER [COLUMN] colname POSITION <newpos>

<newpos>  ::=  an integer between 1 and the number of columns

Example: 

alter table Stock alter Quantity position 3

Note

Don't confuse this with the POSITION in CREATE/ALTER TRIGGER. Trigger positions are and will remain 0-based.

UNIQUE constraints now allow NULLs

Changed in: 1.5

Description: In compliance with the SQL-99 standard, NULLs – even multiple – are now allowed in columns with a UNIQUE constraint. For a full discussion, see CREATE TABLE :: UNIQUE constraints now allow NULLs.

USING INDEX subclause

Added in: 1.5

Description: A USING INDEX subclause can be placed at the end of a primary, unique or foreign key definition. Its purpose is to

  • provide a user-defined name for the automatically created index that enforces the constraint, and

  • optionally define the index to be ascending or descending (the default being ascending).

Syntax: 

[ADD] [CONSTRAINT constraint-name]
   <constraint-type> <constraint-definition>
   [USING [ASC[ENDING] | DESC[ENDING]] INDEX index_name]

For a full discussion and examples, see CREATE TABLE :: USING INDEX subclause.

Prev: DDL statementsFirebird Documentation IndexUp: DDL statementsNext: ALTER TRIGGER
Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateDDL statements → ALTER TABLE