dimanche 28 février 2016

SQLIte ForeignKey to multiple tables

I am having scenario where i have to use two different tables as foreign table where the primary tables remain same but need to map with different tables so required to give two different foreign key with two different table, is it possible?

CREATE TABLE Address1(folderId VARCHAR,uid INTEGER,folderId1 VARCHAR,uid1 INTEGER,type INTEGER,address VARCHAR(256),name VARCHAR(256),"folderId1" VARCHAR, "uid1" INTEGER,PRIMARY KEY (folderId, uid, type, address),
FOREIGN KEY (folderId, uid) REFERENCES MapHeader1(folderId, uid),
FOREIGN KEY (folderId1, uid1) REFERENCES MapHeader2(folderId, did))

I have tried this so far but its not working.Any suggestion or example.

Aucun commentaire:

Enregistrer un commentaire