Re: [sqlite] Foreign Key errors

2014-05-09 Thread phaworth
After looking into error messages further, I see that the constraint name is not included in NOT NULL or UNIQUE constraint errors although it is there in CHECK constraint errors. The table.column that caused the error is in the messages so it is possible to identify which column caused the error.

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Constantine Yannakopoulos
On May 8, 2014 4:39 AM, phaworth p...@lcsql.com wrote: I'd vote for having this as a future enhancement under the control of a pragma or some other way of making it optional. Some of my tables have more than 1 foreign key and without the constraint name I have to write application code to

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Simon Slavin
On 8 May 2014, at 9:00am, Constantine Yannakopoulos alfasud...@gmail.com wrote: When the fk violation occurs inside a large transaction, e.g. during a bulk data import it is essential that the user is given any possible help to be able to locate the data that violates ref integrity and fix

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Constantine Yannakopoulos
On Thu, May 8, 2014 at 11:50 AM, Simon Slavin slav...@bigfraud.org wrote: That's your job. You're the programmer. SQLite does not talk to users and its result values should never be shown to a user. ​Fair enough, but SQLite needs to give me what I need to be able to communicate something

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Simon Slavin
On 8 May 2014, at 10:40am, Constantine Yannakopoulos alfasud...@gmail.com wrote: On Thu, May 8, 2014 at 11:50 AM, Simon Slavin slav...@bigfraud.org wrote: That's your job. You're the programmer. SQLite does not talk to users and its result values should never be shown to a user. ​Fair

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Constantine Yannakopoulos
On Thu, May 8, 2014 at 1:08 PM, Simon Slavin slav...@bigfraud.org wrote: Perhaps a future version of sqlite3_extended_result_codes() can return a string as well as the code, the string being the name of the constraint that was violated. Yes, it would be great to be able to get the necessary

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Walter Hurry
On Thu, 08 May 2014 13:15:54 +0300, Constantine Yannakopoulos wrote: most if not all other databases do not implement this $ psql psql (9.3.4) Type help for help. misc=# create table parent misc-# (a_id varchar(1), misc(# constraint pk_parent primary key(a_id)); CREATE TABLE misc=# create

Re: [sqlite] Foreign Key errors

2014-05-08 Thread Constantine Yannakopoulos
On Thu, May 8, 2014 at 10:52 PM, Walter Hurry walterhu...@gmail.com wrote: On Thu, 08 May 2014 13:15:54 +0300, Constantine Yannakopoulos wrote: most if not all other databases do not implement this $ psql psql (9.3.4) Type help for help. ​snip​ ​I meant that they do not implement a way

Re: [sqlite] Foreign Key errors

2014-05-07 Thread Dominique Devienne
On Tue, May 6, 2014 at 11:17 PM, Richard Hipp d...@sqlite.org wrote: On Tue, May 6, 2014 at 5:12 PM, Peter Haworth p...@lcsql.com wrote: It seems that foreign key errors on columns where the foreign key definition has a constraint name don't include the constraint name in the error message.

Re: [sqlite] Foreign Key errors

2014-05-07 Thread phaworth
I'd vote for having this as a future enhancement under the control of a pragma or some other way of making it optional. Some of my tables have more than 1 foreign key and without the constraint name I have to write application code to pre-check for foreign key errors since I can't translate the

[sqlite] Foreign Key errors

2014-05-06 Thread Peter Haworth
It seems that foreign key errors on columns where the foreign key definition has a constraint name don't include the constraint name in the error message. This is using sqlite version 3.8.3.1. Is this under the control of a compile switch or PRAGMA or am I stuck with the way it is? Pete

Re: [sqlite] Foreign Key errors

2014-05-06 Thread Richard Hipp
On Tue, May 6, 2014 at 5:12 PM, Peter Haworth p...@lcsql.com wrote: It seems that foreign key errors on columns where the foreign key definition has a constraint name don't include the constraint name in the error message. This is using sqlite version 3.8.3.1. Is this under the control of a

Re: [sqlite] Foreign Key errors

2014-05-06 Thread Petite Abeille
On May 6, 2014, at 11:17 PM, Richard Hipp d...@sqlite.org wrote: It is theoretically possible to keep track of which constraints are failing so that the particular constraint can be identified in the error message. But that woudl require more memory and CPU cycles. That would be resources

Re: [sqlite] Foreign Key errors

2014-05-06 Thread Stephan Beal
On Tue, May 6, 2014 at 11:24 PM, Petite Abeille petite.abei...@gmail.comwrote: On May 6, 2014, at 11:17 PM, Richard Hipp d...@sqlite.org wrote: It is theoretically possible to keep track of which constraints are failing so that the particular constraint can be identified in the error

Re: [sqlite] Foreign key vs index (continue)

2013-11-14 Thread Igor Tandetnik
On 11/13/2013 11:14 PM, Igor Korot wrote: But then in order to speed up this query I need to create an index leaguescorehitter(scoreid), right? I don't know. My crystal ball is cloudy lately, I can't quite make out your database schema from here. -- Igor Tandetnik

[sqlite] Foreign key vs index (continue)

2013-11-13 Thread Igor Korot
Hi, ALL, Now that the loop in the query is fixed I want to come back to this topic. Here is modified query plan: sqlite EXPLAIN QUERY PLAN SELECT playersinleague.playerid,scorehits.scorename,l eaguescorehitter.value FROM playersinleague,scorehits,leaguescorehitter WHERE sc orehits.scoreid =

Re: [sqlite] Foreign key vs index (continue)

2013-11-13 Thread Igor Tandetnik
On 11/13/2013 10:13 PM, Igor Korot wrote: What I don't understand is: All fields in WHERE clause are declared as primary/foreign keys. And it still gives full table scan on the first iteration. Defining a foreign key doesn't create any indexes, and doesn't in any way affect the behavior of

Re: [sqlite] Foreign key vs index (continue)

2013-11-13 Thread Keith Medcalf
What I don't understand is: All fields in WHERE clause are declared as primary/foreign keys. And it still gives full table scan on the first iteration. Foreign Key declarations specify referential integrity constraints. Primary Key declarations necessarily create an index to enforce

Re: [sqlite] Foreign key vs index (continue)

2013-11-13 Thread Igor Korot
Igor, On Wed, Nov 13, 2013 at 7:34 PM, Igor Tandetnik i...@tandetnik.org wrote: On 11/13/2013 10:13 PM, Igor Korot wrote: What I don't understand is: All fields in WHERE clause are declared as primary/foreign keys. And it still gives full table scan on the first iteration. Defining a

[sqlite] Foreign Key constraint problem while dropping tables inside transaction

2013-05-13 Thread Григорий Григоренко
Hi, sample database is: PRAGMA FOREIGN_KEYS=1; CREATE TABLE cat(id INTEGER PRIMARY KEY, name); INSERT INTO cat VALUES (1, 'Alice'); CREATE TABLE owner(pet INTEGER REFERENCES cat(id)); INSERT INTO owner VALUES(1); This script fails to drop tables with  'foreign key constraint failed':

Re: [sqlite] Foreign Key constraint problem while dropping tables inside transaction

2013-05-13 Thread Simon Slavin
On 13 May 2013, at 3:54pm, Григорий Григоренко grigore...@mail.ru wrote: sample database is: PRAGMA FOREIGN_KEYS=1; CREATE TABLE cat(id INTEGER PRIMARY KEY, name); INSERT INTO cat VALUES (1, 'Alice'); CREATE TABLE owner(pet INTEGER REFERENCES cat(id)); INSERT INTO owner VALUES(1);

Re: [sqlite] Foreign Key constraint problem while dropping tables inside transaction

2013-05-13 Thread Simon Davies
On 13 May 2013 16:52, Simon Slavin slav...@bigfraud.org wrote: On 13 May 2013, at 3:54pm, Григорий Григоренко grigore...@mail.ru wrote: sample database is: PRAGMA FOREIGN_KEYS=1; CREATE TABLE cat(id INTEGER PRIMARY KEY, name); INSERT INTO cat VALUES (1, 'Alice'); CREATE TABLE owner(pet

Re: [sqlite] Foreign Key constraint problem while dropping tables inside transaction

2013-05-13 Thread Григорий Григоренко
Понедельник, 13 мая 2013, 17:03 +01:00 от Simon Davies simon.james.dav...@gmail.com: On 13 May 2013 16:52, Simon Slavin slav...@bigfraud.org wrote: On 13 May 2013, at 3:54pm, Григорий Григоренко grigore...@mail.ru wrote: sample database is: PRAGMA FOREIGN_KEYS=1; CREATE TABLE cat(id

[sqlite] Foreign key constraint with m:n relationship

2012-12-10 Thread Kristine Peters
Does sqlite3 support foreign key constraints with m:n relations? I can get cascade update/delete to work with 1:n relations, but not m:n. Example, this schema works: (yes, it¹s from the Elmasri text; it shows a 1:n relationship between EMPLOYEE and DEPARTMENT; also the 1:N relationship to the

Re: [sqlite] Foreign key constraint with m:n relationship

2012-12-10 Thread Clemens Ladisch
Kristine Peters wrote: Does sqlite3 support foreign key constraints with m:n relations? In your logical model, you have a M:N relation. In the phyiscal database, however, you implement this as a separate table which can be seen as having two 1:N relations, so what you have are two separate

[sqlite] Foreign Key

2012-09-08 Thread Dennis Klein
Hallo, I am Using the latest Version of the precompiled shell Application from the Download section, and the C/C++ Sources in Version 3.7.11 Now i created my tables, using Primary Key and Foreign Key Constraints. Then I tested it, and inserted test data, with a foreign key which doesn't exist

Re: [sqlite] Foreign Key

2012-09-08 Thread Simon Davies
On 7 September 2012 21:28, Dennis Klein dennis.kl...@education-siemens.com wrote: Hallo, I am Using the latest Version of the precompiled shell Application from the Download section, and the C/C++ Sources in Version 3.7.11 Now i created my tables, using Primary Key and Foreign Key

[sqlite] Foreign key constraint failed

2012-06-03 Thread Jörgen Hägglund
Hi all! I have just recently discovered the strengths of foreign keys but now, I've been banging my head against the wall for a couple of days. I just can't figure out what is causing the error or how to get around it. Here's the specs (simplified) of my DB; create table if not exists a (id

Re: [sqlite] Foreign key constraint failed

2012-06-03 Thread stefanos sofroniou
let me know. Cheers. Stefanos From: Jörgen Hägglund jor...@sirlucifer.mine.nu To: sqlite-users@sqlite.org Sent: Sunday, June 3, 2012 11:10 PM Subject: [sqlite] Foreign key constraint failed Hi all! I have just recently discovered the strengths of foreign

Re: [sqlite] Foreign Key Problems

2012-04-03 Thread Pete
@sqlite.org Subject: Re: [sqlite] Foreign Key Problems Message-ID: 922a3407-7604-4f64-87bc-07221c066...@bigfraud.org Content-Type: text/plain; charset=us-ascii On 2 Apr 2012, at 5:56pm, Pete p...@mollysrevenge.com wrote: Enabling foreign keys in my application works fine and INSERTs thast violate

Re: [sqlite] Foreign Key Problems

2012-04-03 Thread Dan Kennedy
On 04/03/2012 11:18 PM, Pete wrote: Thanks you SImon. I see this is because the version of sqlite3 I have does not support foreign keys. I am running OS X 10.6.8 and sqlite3 comes with the OS. Does anyone know where I can get a version of sqlite3 for OS X that does support foreign keys? It

Re: [sqlite] Foreign Key Problems

2012-04-03 Thread Simon Slavin
On 3 Apr 2012, at 5:38pm, Dan Kennedy danielk1...@gmail.com wrote: On 04/03/2012 11:18 PM, Pete wrote: I am running OS X 10.6.8 and sqlite3 comes with the OS. Does anyone know where I can get a version of sqlite3 for OS X that does support foreign keys? It would have to be a compiled

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Dan Kennedy
On 04/02/2012 07:22 AM, Pete wrote: I'm running into an issue with foreign keys where no matter what value I supply for a child key, I get a foreign key mismatch error. Here are my test tables. foreign key mismatch indicates a schema problem. Usually a missing index. See here:

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pete
Kennedy danielk1...@gmail.com To: sqlite-users@sqlite.org Subject: Re: [sqlite] Foreign Key Problems Message-ID: 4f796450.9030...@gmail.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 04/02/2012 07:22 AM, Pete wrote: I'm running into an issue with foreign keys where

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pete
...@gmail.com To: sqlite-users@sqlite.org Subject: Re: [sqlite] Foreign Key Problems Message-ID: 4f796450.9030...@gmail.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 04/02/2012 07:22 AM, Pete wrote: I'm running into an issue with foreign keys where no matter what value I

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 5:56pm, Pete p...@mollysrevenge.com wrote: Enabling foreign keys in my application works fine and INSERTs thast violate a fkey constraint fail. Is this a know problem with sqlite3? I'm using version 3.6.12 on a Mac. http://sqlite.org/foreignkeys.html This document

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pavel Ivanov
, sqlite-users-requ...@sqlite.org wrote: Message: 12 Date: Mon, 02 Apr 2012 15:33:20 +0700 From: Dan Kennedy danielk1...@gmail.com To: sqlite-users@sqlite.org Subject: Re: [sqlite] Foreign Key Problems Message-ID: 4f796450.9030...@gmail.com Content-Type: text/plain; charset=ISO-8859-1; format

[sqlite] Foreign Key Problems

2012-04-01 Thread Pete
I'm running into an issue with foreign keys where no matter what value I supply for a child key, I get a foreign key mismatch error. Here are my test tables. CREATE TABLE t1 (RefColumn TEXT ,Data TEXT ) CREATE TABLE t2 (FKeyColumn TEXT REFERENCES t1(RefColumn),Data TEXT ) PRAGMA foreign_keys

Re: [sqlite] Foreign Key Problems

2012-04-01 Thread Pavel Ivanov
I get a foreign Key mismatch error.  No matter what value I supply for FKeyColumn, even NULL, I get the same error. Did you create unique index on t1 (RefColumn) ? IIRC, SQLite always fails foreign key check if there's no index on a referenced column. Pavel On Sun, Apr 1, 2012 at 8:22 PM,

[sqlite] Foreign Key MATCH keyword

2011-12-13 Thread Pete
I may not have searched diligently enough but I can't find any information about the purpose of the foreign key MATCH keyword. Is it documented somewhere? Thanks, -- Pete ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Foreign Key MATCH keyword

2011-12-13 Thread Richard Hipp
On Tue, Dec 13, 2011 at 12:23 PM, Pete p...@mollysrevenge.com wrote: I may not have searched diligently enough but I can't find any information about the purpose of the foreign key MATCH keyword. Is it documented somewhere? http://www.sqlite.org/search?q=foreign+key+match

Re: [sqlite] Foreign key mismatch Error

2011-10-01 Thread Madhan Kumar
Thank you all for your Reply.. I figured out the problem.. I added constraint for the Primary Key in Employee Table, then it got solved. I have missed to add constraint,, and it was the issue. On Wed, Sep 28, 2011 at 1:41 AM, Kees Nuyt k.n...@zonnet.nl wrote: On Tue, 27 Sep 2011 14:58:06

[sqlite] Foreign key mismatch Error

2011-09-27 Thread Madhan Kumar
Hello.. In sqlite (version 3.7.7.1), I created two tables with foreign keys as shown below CREATE TABLE [*Employee*] ( [*EmpId*] INT NOT NULL, [EmpName] VARCHAR2(50)); CREATE TABLE [*Department*] ( [DeptID] INTEGER NOT NULL, [DeptName] VARCHAR2(20), [*EmpID*] INTEGER NOT NULL

Re: [sqlite] Foreign key mismatch Error

2011-09-27 Thread Simon Slavin
On 27 Sep 2011, at 11:58am, Madhan Kumar wrote: In sqlite (version 3.7.7.1), I created two tables with foreign keys as shown below CREATE TABLE [*Employee*] ( [*EmpId*] INT NOT NULL, [EmpName] VARCHAR2(50)); CREATE TABLE [*Department*] ( [DeptID] INTEGER NOT NULL,

Re: [sqlite] Foreign key mismatch Error

2011-09-27 Thread Kees Nuyt
On Tue, 27 Sep 2011 14:58:06 +0400, Madhan Kumar askmad...@gmail.com wrote: Hello.. In sqlite (version 3.7.7.1), I created two tables with foreign keys as shown below CREATE TABLE [*Employee*] ( [*EmpId*] INT NOT NULL, [EmpName] VARCHAR2(50)); CREATE TABLE [*Department*] ( [DeptID]

Re: [sqlite] foreign key on delete no action

2011-02-17 Thread BareFeetWare
3. For backwards parsing compatibility, am I better off just leaving the action blank instead of explicitly writing on delete no action? Yes. Good plan. Great, thanks for the definitive response :-) Thanks, Tom BareFeetWare -- Comparison of SQLite GUI tools:

[sqlite] foreign key on delete no action

2011-02-16 Thread BareFeetWare
Hi all, I've been implementing foreign keys in some of my older tables, as detailed at: http://www.sqlite.org/foreignkeys.html usually like this: foreign key ChildTable (ChildColumn1, ChildColumn2) references ParentTable (ParentColumn1, ParentColumn2) on delete cascade

Re: [sqlite] foreign key on delete no action

2011-02-16 Thread Dan Kennedy
foreign key ChildTable (ChildColumn1, ChildColumn2) references ParentTable (ParentColumn1, ParentColumn2) on delete no action I have a few questions: 1. What does SQLite do if the action is just left blank? Does it have the same affect as explicitly writing no action?

[sqlite] Foreign key on different database - possible?

2010-10-20 Thread Frank Millman
Hi all I am using SQLite 3.7.2 on Fedora 10. I have multiple databases, which I can access concurrently by using the 'attach' command, and then referring to each table using 'database.tablename'. It works well. Now I want to create a foreign key constraint where the parent table is in one

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Dan Kennedy
On Oct 20, 2010, at 3:59 PM, Frank Millman wrote: Hi all I am using SQLite 3.7.2 on Fedora 10. I have multiple databases, which I can access concurrently by using the 'attach' command, and then referring to each table using 'database.tablename'. It works well. Now I want to create a

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Frank Millman
Dan Kennedy wrote: On Oct 20, 2010, at 3:59 PM, Frank Millman wrote: Hi all I am using SQLite 3.7.2 on Fedora 10. I have multiple databases, which I can access concurrently by using the 'attach' command, and then referring to each table using 'database.tablename'. It works

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Dan Kennedy
On Oct 20, 2010, at 4:47 PM, Frank Millman wrote: Dan Kennedy wrote: On Oct 20, 2010, at 3:59 PM, Frank Millman wrote: Hi all I am using SQLite 3.7.2 on Fedora 10. I have multiple databases, which I can access concurrently by using the 'attach' command, and then referring to each

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Drake Wilson
Quoth Frank Millman fr...@chagford.com, on 2010-10-20 11:47:06 +0200: Ok, thanks. Is there any chance of it being considered for a future release? Search http://www.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq for foreign key. Frank --- Drake Wilson

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Frank Millman
Drake Wilson wrote: Quoth Frank Millman fr...@chagford.com, on 2010-10-20 11:47:06 +0200: Ok, thanks. Is there any chance of it being considered for a future release? Search http://www.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq for foreign key. Thanks, Drake. I found the following

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Simon Slavin
On 20 Oct 2010, at 12:11pm, Frank Millman wrote: I am writing a generalised business/accounting application, which is multi-company. I have got it working using MS SQL Server and PostgreSQL as databases, and now I want to add sqlite3 as a third option, for small single-user systems and for

[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

Re: [sqlite] foreign key error 01

2010-08-09 Thread Oliver Peters
Oliver Peters oliver@... 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

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 Igor Tandetnik
Oliver Peters oliver@web.de wrote: reproduction CREATE TABLE staff_01( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT NULL, code CHAR(2) NOT NULL, FOREIGN

[sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
This sql code works in the two cases but AFAIK ;-) it shouldn't in the second Am I right? CREATE TABLE staff_01( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT NULL,

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
and the added , after UNIQUE(code) doesn't change anything (oh what a day ;-) ) Oliver ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Igor Tandetnik
Oliver Peters oliver@web.de wrote: This sql code works in the two cases but AFAIK ;-) it shouldn't in the second PRAGMA foreign_keys = ON; CREATE TABLE staff_02( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor INTEGER NOT

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Igor Tandetnik itandet...@... writes: Oliver Peters oliver@... wrote: This sql code works in the two cases but AFAIK it shouldn't in the second PRAGMA foreign_keys = ON; CREATE TABLE staff_02( idINTEGER PRIMARY KEY AUTOINCREMENT,

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Black, Michael (IS)
Directorate Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org on behalf of Oliver Peters Sent: Mon 8/9/2010 8:38 AM To: sqlite-users@sqlite.org Subject: EXTERNAL:Re: [sqlite] foreign key the true error - sqlite 3.7.0.1 Igor Tandetnik

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Simon Davies
On 9 August 2010 14:56, Black, Michael (IS) michael.bla...@ngc.com wrote: From http://www.sqlite.org/foreignkeys.html Although I believe I compiled my shell WITHOUT these defined but I still don't get enforcement of the foreign key constraint. It appears that foreign keys are fully

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
I use the standard windows binary from http://www.sqlite.org/sqlite-3_7_0_1.zip and if I do the recommended test I get sqlite3 SQLite version 3.7.0.1 Enter .help for instructions Enter SQL statements terminated with a ; sqlite pragma foreign_keys; 0 sqlite pragma foreign_keys=ON; sqlite pragma

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Black, Michael (IS)
From: sqlite-users-boun...@sqlite.org on behalf of Simon Davies Sent: Mon 8/9/2010 9:13 AM To: General Discussion of SQLite Database Subject: EXTERNAL:Re: [sqlite] foreign key the true error - sqlite 3.7.0.1 On 9 August 2010 14:56, Black, Michael (IS) michael.bla

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
[...] To my mind the simplified question is: why returns the INSERT INTO a not an error while the INSERT INTO b does? How corresponds this behaviour to the concept of FOREIGN KEYS? I wrote the code into file.sql (encoding=utf8, if this matters) and started sqlite3 -bail test.db3 file.sql

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Dan Kennedy
why returns the INSERT INTO a not an error while the INSERT INTO b does? How corresponds this behaviour to the concept of FOREIGN KEYS? CREATE TABLE a( idINTEGER PRIMARY KEY AUTOINCREMENT, id_staff_editor

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Martin.Engelschalk
Am 09.08.2010 16:57, schrieb Oliver Peters: [...] To my mind the simplified question is: why returns the INSERT INTO a not an error while the INSERT INTO b does? How corresponds this behaviour to the concept of FOREIGN KEYS? I wrote the code into file.sql (encoding=utf8, if this

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Dan Kennedy danielk1...@... writes: why returns the INSERT INTO a not an error while the INSERT INTO b does? How corresponds this behaviour to the concept of FOREIGN KEYS? CREATE TABLE a( idINTEGER PRIMARY KEY AUTOINCREMENT,

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Igor Tandetnik
Oliver Peters oliver@web.de wrote: Please believe me I really try hard to understand - but what I don't understand is the fact that you can insert in this case: PRAGMA foreign_keys = ON; /* **success INSERT = yes */ CREATE TABLE a( id

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Oliver Peters
Igor Tandetnik itandet...@... writes: [...] Why would you want to fail statements that end up not violating any constraints? The idea is to prevent that somebody can change the table staff that is not already in the table. Therefore I create the first user by not switching on foreign keys.

[sqlite] Foreign key support in Sqlite

2010-01-03 Thread Luciano de Souza
Hello listers, I am trying to migrate to Sqlite3.6.21. I visited the Sqlite site and downloaded the compiled file. I'm surprised in verifying that the zip only had the executable. I hoped to find also the DLL. Well, since I could not find the DLL file concerning this version, I presumed DLL

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Jean-Christophe Deschamps
Hi, I am trying to migrate to Sqlite3.6.21. I visited the Sqlite site and downloaded the compiled file. I'm surprised in verifying that the zip only had the executable. I hoped to find also the DLL. I bet you downloaded this: http://www.sqlite.org/sqlite-3_6_21.zip This is the CLI, he

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Luciano de Souza
the constraint. What am I doing wrong? - Original Message - From: Jean-Christophe Deschamps j...@q-e-d.org To: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Sunday, January 03, 2010 2:09 PM Subject: Re: [sqlite] Foreign key support in Sqlite Hi, I am trying

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Igor Tandetnik
Luciano de Souza wrote: Everything downloaded correctly, but there is still something wrong. http://www.sqlite.org/foreignkeys.html#fk_enable http://www.sqlite.org/pragma.html#pragma_foreign_keys Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Jean-Christophe Deschamps
create table cities ( id integer primary key not null, name text not null ); create table people ( id integer primary key not null, name text not null, cities_id integer not null, foreign key(cities_id) references cities(id) ); insert into cities(name) values('Campos'); insert into cities(name)

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Luciano de Souza
added contrarily the foreign key constraint. - Original Message - From: Jean-Christophe Deschamps j...@q-e-d.org To: General Discussion of SQLite Database sqlite-users@sqlite.org Sent: Sunday, January 03, 2010 2:51 PM Subject: Re: [sqlite] Foreign key support in Sqlite create table

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Roger Andersson
-Ursprungligt meddelande- Från: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] För Luciano de Souza Skickat: den 3 januari 2010 19:05 Till: General Discussion of SQLite Database Ämne: Re: [sqlite] Foreign key support in Sqlite I can't comprehend! I

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Luciano de Souza
: Sunday, January 03, 2010 4:04 PM Subject: Re: [sqlite] Foreign key support in Sqlite I can't comprehend! I downloaded the two packs in c:\test. Three files were unpacked: sqlite3.exe, sqlite3.dll and sqlite3.def. I created the database: c: sqlite3 test.db I create the structure: sqlite

Re: [sqlite] Foreign key support in Sqlite

2010-01-03 Thread Luciano de Souza
- From: Roger Andersson r...@telia.com To: 'General Discussion of SQLite Database' sqlite-users@sqlite.org Sent: Sunday, January 03, 2010 4:10 PM Subject: Re: [sqlite] Foreign key support in Sqlite -Ursprungligt meddelande- Från: sqlite-users-boun...@sqlite.org [mailto:sqlite-users

Re: [sqlite] foreign key mismatch error

2009-12-04 Thread Paul Shaffer
Original Message On Dec 4, 2009, at 12:31 PM, Paul Shaffer wrote: Below are 3 tables. When I delete a row in Item with related rows in Item_attribute I get the dreaded foreign key mismatch error. I've read through the documentation and don't see what I'm doing wrong.

[sqlite] foreign key mismatch error

2009-12-03 Thread Paul Shaffer
Below are 3 tables. When I delete a row in Item with related rows in Item_attribute I get the dreaded foreign key mismatch error. I've read through the documentation and don't see what I'm doing wrong. sqlite v 1.6.20 CREATE TABLE [Item_attribute] ( ItemIDinteger NOT NULL,

Re: [sqlite] foreign key mismatch error

2009-12-03 Thread Dan Kennedy
On Dec 4, 2009, at 12:31 PM, Paul Shaffer wrote: Below are 3 tables. When I delete a row in Item with related rows in Item_attribute I get the dreaded foreign key mismatch error. I've read through the documentation and don't see what I'm doing wrong. There are no FK mismatches in the

[sqlite] Foreign Key constraint as column constraint?

2009-11-25 Thread Jan
Hi, I am testing the new fk support in my db. Currently I have *column constraints* for fk that were parsed by genfkey to create triggers. Simply adding FOREIGN KEY (column) to the column constr. seems not to work. But moving everything to the end of the table definition as a table constraint

Re: [sqlite] Foreign Key constraint as column constraint?

2009-11-25 Thread Pavel Ivanov
According to http://www.sqlite.org/lang_createtable.html you can mention foreign-key-clause (starting with REFERENCES) as column-constraint. Why it doesn't work for you? Pavel On Wed, Nov 25, 2009 at 10:33 AM, Jan janus...@gmx.net wrote: Hi, I am testing the new fk support in my db. Currently

Re: [sqlite] Foreign Key constraint as column constraint?

2009-11-25 Thread Jan
Sry, was a bit confused You are right :-) Of course FOREIGN KEY makes no sense in a column const. ... Pavel Ivanov schrieb: According to http://www.sqlite.org/lang_createtable.html you can mention foreign-key-clause (starting with REFERENCES) as column-constraint. Why it doesn't work for

[sqlite] Foreign Key constraint checking

2009-07-31 Thread Shaun Seckman (Firaxis)
Hello, I am well aware that SQLite doesn't enforce FK's and that a way around this is to use triggers. This lack of enforcing actually has worked to my advantage as when populating my database I can insert data out of order. However, after all data has been inserted into the database, I'd

Re: [sqlite] Foreign Key constraint checking

2009-07-31 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shaun Seckman (Firaxis) wrote: I am well aware that SQLite doesn't enforce FK's and that a way around this is to use triggers. Hopefully you are also aware of the genfkey functionality in the shell which lets you automate generation of those

[sqlite] Foreign key support

2009-07-16 Thread Lothar Behrens
Hi, I know there is no real support for foreign keys, but I read about the genfkey tool in the shell. This is probably based on the fk tool from Cody Pisto cpi...@gmail.com that I am also using. I added support to use the fk source as library in my code to rewrite DDL statements on the

[sqlite] foreign key problems

2009-06-05 Thread robinsmathew
hey i hve created a table CREATE TABLE video_tab (video_id INTEGER, project_id INTEGER, video_path VARCHAR(100), video_length INTEGER, video_type VARCHAR(10), video_size VARCHAR(10), CONSTRAINT video_pk PRIMARY KEY(video_id, project_id), CONSTRAINT fk_project_id FOREIGN KEY (project_id)

Re: [sqlite] foreign key problems

2009-06-05 Thread Igor Tandetnik
robinsmathew wrote: hey i hve created a table CREATE TABLE video_tab (video_id INTEGER, project_id INTEGER, video_path VARCHAR(100), video_length INTEGER, video_type VARCHAR(10), video_size VARCHAR(10), CONSTRAINT video_pk PRIMARY KEY(video_id, project_id), CONSTRAINT fk_project_id FOREIGN

Re: [sqlite] Foreign key support

2009-03-04 Thread BareFeet
Hi all, It is true that triggers can be used to achieve referential integrity. However you don't have to hand craft them. the SQLite team has already done all the work for you. The SQLite source includes a program named 'genfkey' that will create the triggers. So the next step is

Re: [sqlite] Foreign key support

2009-03-04 Thread Dan
On Mar 5, 2009, at 10:25 AM, BareFeet wrote: Hi all, It is true that triggers can be used to achieve referential integrity. However you don't have to hand craft them. the SQLite team has already done all the work for you. The SQLite source includes a program named 'genfkey' that will

Re: [sqlite] Foreign key support

2009-03-04 Thread BareFeet
Hi Dan, According to the readme: http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README I should be able to run genfkey directly from within the command line tool, but it doesn't seem to work The change to add the genfkey functionality to the shell is still in cvs. It will

[sqlite] Foreign key support

2009-01-30 Thread Adam DeVita
Good day, If I write into the sqlite3 using the analyzer: create table mysns (SN int primary key, desc text); insert into mysns (SN, desc) values (1,2); create table t2 (mynum int, desc2 text, SN references mysns(SN) ); insert into t2 (mynum, desc2, SN) values (1,two, 3); This insert didn't

Re: [sqlite] Foreign key support

2009-01-30 Thread P Kishor
On Fri, Jan 30, 2009 at 11:25 AM, Adam DeVita adev...@verifeye.com wrote: Good day, If I write into the sqlite3 using the analyzer: create table mysns (SN int primary key, desc text); insert into mysns (SN, desc) values (1,2); create table t2 (mynum int, desc2 text, SN references mysns(SN)

Re: [sqlite] Foreign key support

2009-01-30 Thread Dan
On Jan 31, 2009, at 12:25 AM, Adam DeVita wrote: Good day, If I write into the sqlite3 using the analyzer: create table mysns (SN int primary key, desc text); insert into mysns (SN, desc) values (1,2); create table t2 (mynum int, desc2 text, SN references mysns(SN) ); insert into t2

Re: [sqlite] Foreign Key

2008-11-25 Thread Simon Davies
2008/11/25 Satish [EMAIL PROTECTED]: Hi All! I have a small question that Foreign key Constraint is now supported by SQLite or not.I had this question because in an SQLite table for a Foreign key ON DELETE CASCADE or ON UPDATE CASCADE are not working.Is there any problem with my

  1   2   >