Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

foreign key referring to same table is not supported..

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 
Tags:
Former Member
replied

That's supported as of SPS 10 but not on earlier SPs.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question