Re: [sqlite] Foreign Key error

2018-07-31 Thread J Decker
I thought this was that index index,sqlite_autoindex_ option4_name_1,option4_name,3, but maybe that's the unique on name. I see; I guess it is missing; indexes get created now more properly. I deleted it and recreated it, which created the indexes more properly. thanx, and sorry for the noise.

Re: [sqlite] Foreign Key error

2018-07-31 Thread Clemens Ladisch
J Decker wrote: > CREATE TABLE `option4_name` (`name_id` char(36) NOT NULL,`name` > varchar(255) NOT NULL default '' CONSTRAINT `name` UNIQUE) > FOREIGN KEY (`name_id`) REFERENCES `option4_name`(`name_id`) > foreign key mismatch - "option4_map" referencing "option4_name" name_id must be the

Re: [sqlite] Foreign Key error

2018-07-30 Thread J Decker
test.db https://drive.google.com/open?id=1gX4QDLy3rA1YVFXZnhj_vlAClVmrU4Cz SQLite version 3.9.2 2015-11-02 18:31:45 Enter ".help" for usage hints. sqlite> pragma foreign_keys=on; sqlite> Insert into option4_map(`option_id`,`parent_option_id`,`name_id`) values

Re: [sqlite] Foreign Key error

2018-07-30 Thread J Decker
On Mon, Jul 30, 2018 at 2:11 PM Keith Medcalf wrote: > > >"SQLITE_ENABLE_LOCKING_STYLE=0","SQLITE_THREADSAFE=0", > >"SQLITE_OMIT_UTF16","SQLITE_ENABLE_COLUMN_METADATA=1", > >"SQLITE_DEFAULT_FOREIGN_KEYS=1" > > >Is there something about the combination of options I've used? > > Do you get

Re: [sqlite] Foreign key error...

2017-01-11 Thread Ken Wagner
Keith, Good point. Did not know this exists. Ken On 01/10/2017 09:48 PM, Simon Slavin wrote: On 11 Jan 2017, at 1:02am, Keith Medcalf wrote: You are correct, however, if there were a unique constraint placed on tracks.name, then a given track could only appear once

Re: [sqlite] Foreign key error...

2017-01-10 Thread Simon Slavin
On 11 Jan 2017, at 1:02am, Keith Medcalf wrote: > You are correct, however, if there were a unique constraint placed on > tracks.name, then a given track could only appear once (in the first case), > or in multiple places (in the second case). _The Power of Love_ was

Re: [sqlite] Foreign key error...

2017-01-10 Thread Keith Medcalf
te.org] > On Behalf Of Ken Wagner > Sent: Monday, 9 January, 2017 23:46 > To: SQLite mailing list > Subject: Re: [sqlite] Foreign key error... > > Keith, > > "this does not allow the same track on multiple albums" with the same > trackno, but a different

Re: [sqlite] Foreign key error...

2017-01-10 Thread David Raymond
gnifys, so yeah, it's a little hidden. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of James K. Lowden Sent: Tuesday, January 10, 2017 1:14 PM To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] Foreign key error... On S

Re: [sqlite] Foreign key error...

2017-01-10 Thread James K. Lowden
On Sun, 08 Jan 2017 05:57:46 -0700 "Keith Medcalf" wrote: > artistid integer references artists Hmph. Learn something new every day. Where is that abbreviated form documented? I looked for "references" on the Create Table page, and didn't find anything about its

Re: [sqlite] Foreign key error...

2017-01-09 Thread Ken Wagner
lumnNameBetweenTheFirstAndTheSecondTabl e = TheSecondTableToBeJoined.TheCommonColumnNameBetweenTheFirstAndTheSecondTab le; -Original Message- From: sqlite-users [mailto:sqlite-users- boun...@mailinglists.sqlite.org] On Behalf Of Ken Wagner Sent: Sunday, 8 January, 2017 04:04 To: SQLite mailing lis

Re: [sqlite] Foreign key error...

2017-01-09 Thread Ken Wagner
Yes, thanks. The 'left join on' or 'inner join on ' removes the chance of an erroneous key linkage. Also makes sense to pay close attention as to which table is left and right. Ken On 01/09/2017 06:46 AM, Dominique Devienne wrote: On Sun, Jan 8, 2017 at 12:46 PM, Keith Medcalf

Re: [sqlite] Foreign key error...

2017-01-09 Thread Dominique Devienne
On Sun, Jan 8, 2017 at 12:46 PM, Keith Medcalf wrote: > > ... join ... using (column) has nothing whatever to do with foreign keys. > > "FROM a JOIN b USING (c) is "syntactic sugar" ([...]) for the expression > "FROM a, b WHERE a.c = b.c" > Or "FROM a JOIN b ON a.c = b.c".

Re: [sqlite] Foreign key error...

2017-01-08 Thread J Decker
ING (TheCommonColumnNameBetweenTheFirstAndTheSecondTable); > > > -vs- > > > SELECT * FROM TheFirstTableToBeJoined, TheSecondTableToBeJoined WHERE > > TheFirstTableToBeJoined.TheCommonColumnNameBetweenTheF > irstAndTheSecondTabl > > e = > > TheSecondTabl

Re: [sqlite] Foreign key error...

2017-01-08 Thread Keith Medcalf
dTab > le; > > > > > >> -Original Message- > >> From: sqlite-users [mailto:sqlite-users- > boun...@mailinglists.sqlite.org] > >> On Behalf Of Ken Wagner > >> Sent: Sunday, 8 January, 2017 04:04 > >> To: SQLite mailing list > >>

Re: [sqlite] Foreign key error...

2017-01-08 Thread Ken Wagner
TheFirstAndTheSecondTable = TheSecondTableToBeJoined.TheCommonColumnNameBetweenTheFirstAndTheSecondTable; -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Ken Wagner Sent: Sunday, 8 January, 2017 04:04 To: SQLite mailing list Subject: Re: [

Re: [sqlite] Foreign key error...

2017-01-08 Thread Keith Medcalf
; Sent: Sunday, 8 January, 2017 04:04 > To: SQLite mailing list > Subject: Re: [sqlite] Foreign key error... > > Thanks, Kees, > > The message is helpful as a warning. > > select artistname, trackname from artist inner join track on > trackartist = artistid; works jus

Re: [sqlite] Foreign key error...

2017-01-08 Thread Ken Wagner
Thanks, Kees, The message is helpful as a warning. select artistname, trackname from artist inner join track on trackartist = artistid; works just fine. But isn't the efficiency of 'using (artistid)' more desirable? Is the use of a 'trackerartist' as the foreign key used because it is more

Re: [sqlite] Foreign key error...

2017-01-08 Thread Kees Nuyt
On Sun, 8 Jan 2017 04:21:16 -0600, Ken Wagner wrote: >Hello SQLusers, > > The error below occurs even though the > > CREATE TABLE track( > > trackid INTEGER, > trackname TEXT, > trackartist INTEGER, > *FOREIGN KEY(trackartist) REFERENCES artist(artistid)* > );

[sqlite] Foreign key error...

2017-01-08 Thread Ken Wagner
Hello SQLusers, The error below occurs even though the CREATE TABLE track( trackid INTEGER, trackname TEXT, trackartist INTEGER, *FOREIGN KEY(trackartist) REFERENCES artist(artistid)* ); statement at https://sqlite.org/foreignkeys.html was observed. It appears that

Re: [sqlite] foreign key error 01

2010-08-09 Thread Igor Tandetnik
Oliver Peters wrote: > reproduction > > > CREATE TABLE staff_01( > idINTEGER PRIMARY KEY AUTOINCREMENT, > id_staff_editor INTEGER NOT NULL, > code CHAR(2) NOT NULL, >

Re: [sqlite] foreign key error 01

2010-08-09 Thread Black, Michael (IS)
on behalf of Oliver Peters Sent: Mon 8/9/2010 7:46 AM To: sqlite-users@sqlite.org Subject: EXTERNAL:[sqlite] foreign key error 01 Hello environment --- OS : Win XP (every patch) sqlite : 3.7.0.1 reproduction CREATE TABLE staff_01( id

Re: [sqlite] foreign key error 01

2010-08-09 Thread Oliver Peters
Oliver Peters writes: sorry, my FK-clause was wrong (forgot the _01 & 0_2) my mistake (but the next thread will show the true error) Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] foreign key error 01

2010-08-09 Thread Oliver Peters
Hello environment --- OS : Win XP (every patch) sqlite : 3.7.0.1 reproduction CREATE TABLE staff_01( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor