MSCEWI2032

Columns were reordered.

Severity

Low

Description

One or more of the referenced columns inside the REFERENCES portion of the FOREIGN KEY were reordered to match the indexes (or positions) of the specified table.

Example Code

Input Code:

CREATE TABLE FK1(
COL1 INTEGER,
COL2 INTEGER,
COL3 INTEGER,
PRIMARY KEY (COL1, COL2))
PRIMARY INDEX (COL1, COL2, COL3);
CREATE TABLE FK2(
COL1 INTEGER,
COL2 INTEGER,
COL3 INTEGER,
-- The column references here require reordering.
FOREIGN KEY (COL1, COL2, COL3) REFERENCES FK1 (COL2, COL1, COL3)
);

Output Code:

CREATE TABLE DATAWAREHOUSE.PUBLIC.FK1 (
COL1 INTEGER,
COL2 INTEGER,
COL3 INTEGER,
PRIMARY KEY (COL1, COL2));
CREATE TABLE DATAWAREHOUSE.PUBLIC.FK2 (
COL1 INTEGER,
COL2 INTEGER,
COL3 INTEGER
);
/*** MSC-WARNING - MSCEWI2032 - REFERENCED COLUMNS WERE REORDERED TO MATCH FK1 INDEXES ***/
ALTER TABLE DATAWAREHOUSE.PUBLIC.FK2 ADD CONSTRAINT COL1
FOREIGN KEY (COL1, COL2, COL3) REFERENCES DATAWAREHOUSE.PUBLIC.FK1 (COL1, COL2, COL3) ;

Recommendations

  • No additional user actions are required.

  • For more support, you can email us at [email protected] or post a message to our forums. If you have a contract for support with Mobilize.Net, reach out to your sales engineer and they can direct your support needs.