Skip to content

ALTER TABLE in general #19

Open
Open

Description

@lscheffler

The format of the command is odd.
In general it is tricky to see what parameter belongs to what use of ALTER TABLE (out of the 3 uses)

ALTER TABLE TableName1 [DROP [COLUMN] FieldName3] 
   [SET CHECK lExpression3 [ERRORcMessageText3]] [DROP CHECK] 
   [ADD PRIMARY KEY eExpression3 [FOR lExpression4] TAG TagName2
   [COLLATE cCollateSequence]] [DROP PRIMARY KEY] 
   [ADD UNIQUE eExpression4 [[FOR lExpression5] TAG TagName3 
      [COLLATE cCollateSequence]]] [DROP UNIQUE TAG TagName4] 
   [ADD FOREIGN KEY [eExpression5] [FOR lExpression6] TAG TagName4 
      REFERENCES TableName4 [TAG TagName4][COLLATE cCollateSequence]
      REFERENCES TableName2 [TAG TagName5]] 
   [DROP FOREIGN KEY TAG TagName6 [SAVE]] 
   [RENAME COLUMN FieldName4 TO FieldName5] [NOVALIDATE]
ALTER TABLE TableName1 [DROP [COLUMN] FieldName3] 
   [SET CHECK lExpression3 [ERRORcMessageText3]]
   [DROP CHECK] 
   [ADD PRIMARY KEY eExpression3 [FOR lExpression4] TAG TagName2
      [COLLATE cCollateSequence]]
   [DROP PRIMARY KEY] 
   [ADD UNIQUE eExpression4 [TAG TagName3 [FOR lExpression5]
      [COLLATE cCollateSequence]]]
   [DROP UNIQUE TAG TagName4] 
   [ADD FOREIGN KEY [eExpression5] TAG TagName4 [FOR lExpression6]
      [COLLATE cCollateSequence]
      REFERENCES TableName2 [TAG TagName5]] 
   [DROP FOREIGN KEY TAG TagName6 [SAVE]] 
   [RENAME COLUMN FieldName4 TO FieldName5]
   [NOVALIDATE]
  • Later on, the description of ADD FOREIGN KEY is splitted into ADD FOREIGN KEY and REFERENCES. This is wrong, they belong together (ADD FOREIGN KEY must have REFERENCES), but this is not visible here.

Activity

  1. self-assigned this
    on Jun 9, 2022
  2. added a commit that references this issue on Jun 24, 2022
    0da5316
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions