Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQLite On delete cascade .sch ?
Re: SQLite On delete cascade .sch ? [message #51966 is a reply to message #51958] Thu, 27 June 2019 20:55 Go to previous messageGo to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Well ,

According to stack overflow/Sqlite documentation, sqlite table cannot be altered after creation.
Since PGSQL alter table to add reference constraint, it do not work on sqlite.

Here is how we create a reference in SQLite :

CREATE TABLE "OW_EQUIPES_PLAYERS" (
	"EP_EQUIPE_ID"	integer,
	"EP_PLAYER_ID"	integer,
	FOREIGN KEY("EP_EQUIPE_ID") REFERENCES "OW_EQUIPES"("EQUIPE_ID") ON DELETE CASCADE,
	FOREIGN KEY("EP_PLAYER_ID") REFERENCES "OW_PLAYERS"("PLAYER_ID") ON DELETE CASCADE
);


So I had try something like that :
#ifndef REFERENCES
#define REFERENCES(x) 		      ATTRIBUTE("FOREIGN KEY(@c) REFERENCES (@x) ON DELETE CASCADE,","");
#endif

#ifndef REFERENCES_CASCADE
#define REFERENCES_CASCADE(x) 	      ATTRIBUTE("FOREIGN KEY(@c) REFERENCES (@x) ON DELETE CASCADE,","");
#endif

#ifndef REFERENCES_
#define REFERENCES_(n, x)	      ATTRIBUTE("FOREIGN KEY(@c) REFERENCES " #n "(@x) ON DELETE CASCADE,","");
#endif

#ifndef REFERENCES_CASCADE_
#define REFERENCES_CASCADE_(n, x)    ATTRIBUTE("FOREIGN KEY(@c) REFERENCES " #n "(@x) ON DELETE CASCADE,","");
#endif


But Seems not working, moreover my bad knowledge of Upp SQL does not really help.

Have you any idea ?

Thanks in advance
Best Regard
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sqlite join from select
Next Topic: Multiple DUAL_UNIQUE generate conflicting statements
Goto Forum:
  


Current Time: Fri Apr 19 14:16:25 CEST 2024

Total time taken to generate the page: 0.03435 seconds