MSCEWI3002

Foreign key data type mismatch.

triangle-exclamation

Severity

Medium

Description

This error happens when there is a mismatch in a foreign key data type.

Example Code

Input Code:

CREATE TABLE "MyDb"."MyTable"
(
    "COL1" NUMBER,
    CONSTRAINT "PK" PRIMARY KEY ("COL1")
);

CREATE TABLE "MyDb"."MyTable1"
(   
    "COL1" NUMBER(*,0),
    CONSTRAINT "FK1" FOREIGN KEY ("COL1") REFERENCES "MyDb"."MyTable" ("COL1")
);

Output Code:

circle-info

Note that "MyDb"."MyTable1".COL1 and "MyDb"."MyTable".COL1 are of different types and the ERROR is displayed.

Recommendations

Last updated