Repository navigation
Open
Description
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]
- The DROP are not part of the ADD
- The FOR are placed like in the descreiption below
- The REFERENCES TableName4 [TAG TagName4] is useless. This might be the reason for the COLLATE hickup
- Better might be (including ALTER TABLE .. ADD FOREIGN KEY, problem with COLLATE #18 )
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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
ALTER TABLE in general