1 (edited by v_pozidis 2022-03-06 14:46:01)

Topic: Help with SQL script plssssssss

Hi I have the following script which MVDB give me an error and I can not find it. This is just an example with 2 FOREIGN KEYs.
Following the rules of SQL I see I do not have an error


sqlexecute('CREATE TABLE Protypa (id int NOT null, mera DATE, tilefono TEXT, sxolia TEXT,
                   id_alfa Integer,  FOREIGN KEY (id_alfa) REFERENCES  alfa,
                 id_vita Integer,  FOREIGN KEY (id_vita) REFERENCES  vita,
                PRIMARY KEY (ID))');

PLEASE your help

Re: Help with SQL script plssssssss

sqlexecute('CREATE TABLE Protypa (id int NOT null, 
mera DATE, 
tilefono TEXT, 
sxolia TEXT,
id_alfa Integer, 
id_vita Integer,   
FOREIGN KEY (id_alfa) REFERENCES  alfa (id),
FOREIGN KEY (id_vita) REFERENCES  vita (id),
PRIMARY KEY (ID))');

https://www.sqlitetutorial.net/sqlite-foreign-key/

Re: Help with SQL script plssssssss

Thank you....