cancel
Showing results for 
Search instead for 
Did you mean: 

foreign key referring to same table is not supported..

Former Member
0 Kudos

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 

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Lars,

how can I determine which service pack I am into with the version number below.

1.00.85.00.397590.

I hope HCP is still using SP8.

lbreddemann
Active Contributor
0 Kudos

That's a pretty common and often answered question here on SCN!

The SPS can typically derived from the revision by taking the revision number and remove any numbers lower than the 10 value.

E.g. 85 is SPS 8, 97.01 is SPS 9 and 102.1 is SPS 10.

Answers (0)