[sqlite] Checking the integrity of FOREIGN KEYs

2011-11-19 Thread Simon Slavin
So does PRAGMA integrity_check (or any other function of SQLite) check to see that FOREIGN KEY records are there ? Or can it in future versions ? Please ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Simple one

2011-11-19 Thread Matt Young
Well, it was listed as an initial option o the trigger, so I didn't quite get it either. On Sat, Nov 19, 2011 at 7:02 PM, Igor Tandetnik wrote: > Matt Young wrote: > > sqlite> drop trigger if exists mytrigger; > > sqlite> create trigger mytrigger

Re: [sqlite] Simple one

2011-11-19 Thread Simon Slavin
On 20 Nov 2011, at 5:04am, Matt Young wrote: >> sqlite> drop trigger if exists mytrigger; >> sqlite> create trigger mytrigger after insert on result >> ...> begin >> ...> select 'Test2'; >> ...> end; >> sqlite> insert into result values(0,0,0); >> sqlite> >> >> Explain the path of select

Re: [sqlite] Simple one

2011-11-19 Thread Igor Tandetnik
Matt Young wrote: > sqlite> drop trigger if exists mytrigger; > sqlite> create trigger mytrigger after insert on result > ...> begin > ...> select 'Test2'; > ...> end; > sqlite> insert into result values(0,0,0); > sqlite> > > Explain the path of select here? What do

Re: [sqlite] can you select series with SQL?

2011-11-19 Thread Jean-Christophe Deschamps
> so the consecutive numbers, going down from 14? Sorry I interpreted the question in a dumb way. Igor is certainly right (as usual). ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Simple one

2011-11-19 Thread Matt Young
sqlite> drop trigger if exists mytrigger; sqlite> create trigger mytrigger after insert on result ...> begin ...> select 'Test2'; ...> end; sqlite> insert into result values(0,0,0); sqlite> Explain the path of select here? ___ sqlite-users

Re: [sqlite] can you select series with SQL?

2011-11-19 Thread Igor Tandetnik
Bart Smissaert wrote: > If we have the 14 (we know to start at 14) can we select the records > 14, 13, 12 and 11, > so the consecutive numbers, going down from 14? select * from MyTable t1 where (select count(*) from MyTable t2 where t2.ID between t1.ID and 14) == 14 -

Re: [sqlite] can you select series with SQL?

2011-11-19 Thread Jean-Christophe Deschamps
ID 1 2 3 4 11 12 13 14 If we have the 14 (we know to start at 14) can we select the records 14, 13, 12 and 11, so the consecutive numbers, going down from 14? Sure: select id from yourtable where id <= 14 limit 4 order by id desc;

[sqlite] can you select series with SQL?

2011-11-19 Thread Bart Smissaert
Say we have a table table1 with unique integer field ID. Now we have the following data: ID 1 2 3 4 11 12 13 14 If we have the 14 (we know to start at 14) can we select the records 14, 13, 12 and 11, so the consecutive numbers, going down from 14? RBS

Re: [sqlite] Is this a bug? Can't tell from docs....

2011-11-19 Thread Jay A. Kreibich
On Fri, Nov 18, 2011 at 05:30:20PM -0800, Yang Zhang scratched on the wall: > I just got bit by some peculiar behavior in sqlite where > >  id int primary key > is different from: >  id integer primary key > In particular, sqlite will generate values for the latter but not the former: Well,