Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Can we create self referencing foreign key in SAP HANA?

$
0
0

Hi Experts,

 

 

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: [7]: 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.




Regards,

Jimit Doshi


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>