News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
New SQLite version in 0.7?
Author Message
jpjacobs
Member
***


Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
RE: New SQLite version in 0.7?

Yeah, I was trying to use foreign keys. It does not give a syntax error, which is already fine, but it just does not work. Example SQL:

Code:
PRAGMA foreign_keys=ON;
CREATE TABLE artist(
  artistid    INTEGER PRIMARY KEY,
  artistname  TEXT
);
INSERT INTO "artist" VALUES(NULL,'Dean Martin');
INSERT INTO "artist" VALUES(NULL,'Frank Sinatra');

CREATE TABLE track(
  trackid     INTEGER,
  trackname   TEXT,
  trackartist INTEGER,
  FOREIGN KEY(trackartist) REFERENCES artist(artistid)
);
INSERT INTO "track" VALUES(NULL,'That''s Amore',1);
INSERT INTO "track" VALUES(NULL,'Christmas Blues',1);
INSERT INTO "track" VALUES(NULL,'My Way',2);
INSERT INTO "track" VALUES(NULL,'Mr. Bojangles',3);


This should not work, as there is no artist with artistID = 3.

greetz,
JP

This post was last modified: 05-14-2010 02:38 AM by jpjacobs.

05-14-2010 02:31 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
New SQLite version in 0.7? - jpjacobs - 05-06-2010, 01:38 AM
RE: New SQLite version in 0.7? - JohnMurga - 05-11-2010, 01:22 AM
RE: New SQLite version in 0.7? - jpjacobs - 05-11-2010, 02:11 AM
RE: New SQLite version in 0.7? - JohnMurga - 05-13-2010, 12:52 AM
RE: New SQLite version in 0.7? - jpjacobs - 05-14-2010 02:31 AM
RE: New SQLite version in 0.7? - JohnMurga - 05-20-2010, 08:01 PM
RE: New SQLite version in 0.7? - JohnMurga - 10-13-2010, 05:10 AM
RE: New SQLite version in 0.7? - jpjacobs - 10-13-2010, 06:23 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: