Hi Everyone,
Trying to create a foreign key referring to the primary key of same table. But prompted with, feature not supported: cannot create foreign key constraint referring to the same table.
Is it possible to create this link by any other means...
Please go through below syntax:
CREATE COLUMN TABLE "NEO_xxxxx"."C_EMPLOYEES" ("EMPLOYEENUMBER" INTEGER CS_INT NOT NULL ,
"LASTNAME" NVARCHAR(50) NOT NULL ,
"REPORTSTO" NVARCHAR(50) NULL ,
PRIMARY KEY ("EMPLOYEENUMBER"));
| ALTER TABLE "NEO_xxxx"."C_EMPLOYEES" ADD CONSTRAINT "EMPLOYEES_FK2" FOREIGN KEY (REPORTSTO) REFERENCES "NEO_xxxx"."C_EMPLOYEES" (EMPLOYEENUMBER) ON UPDATE RESTRICT ON DELETE CASCADE |