Can we create self referencing foreign key in SAP HANA?
I am executing below commands for creating self referencing foreign key in SAP HANA.
I got the below two commands from SAP Help Portal.
CREATE TABLE SELF(A INTEGER PRIMARY KEY, B INTEGER);
ALTER TABLE SELF ADD CONSTRAINT FK_T1 FOREIGN KEY(B) REFERENCES SELF(A);
While executing above commands, the first command(i.e Create command) is working properly.
But Alter command is giving below error:
Could not execute 'ALTER TABLE SELF ADD CONSTRAINT FK_T1 FOREIGN KEY(B) REFERENCES SELF(A)' in 3 ms 76 µs .
SAP DBTech JDBC: : feature not supported: cannot create foreign key constraint referencing the same table
Can anyone help me out with the above error.
I tried executing the above commands in both SAP HANA SPS 8 as well as SPS 9 but then also I am getting the above error.