Re: [sqlite] [newbie] linking two tables with index...

2008-07-01 Thread Mihai Limbasan
Mihai Limbasan wrote: > In your example it wasn't. Oops, misread what you wrote. What I mean is that it doesn't matter whether the ID is autogenerated or not (of course, if it isn't then the whole issue becomes moot - it in fact *should* be PRIMARY KEY AUTOINCREMENT.)

Re: [sqlite] [newbie] linking two tables with index...

2008-07-01 Thread Mihai Limbasan
Igor Tandetnik wrote: >> Sure. I'll use your examples, just making sure to add an id insertion >> in the first statement since the id column isn't specified as >> autoincrement. >> > > But it _is_ specified as INTEGER PRIMARY KEY. In your example it wasn't. It also wasn't in Martin's original

Re: [sqlite] [newbie] linking two tables with index...

2008-07-01 Thread Mihai Limbasan
Igor Tandetnik wrote: > Can you show an example of a trigger that would make these statements > work: > > insert into snapshot (bumf) values ('one'); > insert into sample(type, used) values ('a', 1); > insert into sample(type, used) values ('b', 1); > > so that, at the end, the two new records in

Re: [sqlite] [newbie] linking two tables with index...

2008-07-01 Thread Igor Tandetnik
Mihai Limbasan <[EMAIL PROTECTED]> wrote: >> Igor Tandetnik wrote: >>> You can't make this happen automatically with SQLite. > >> Hmm? Of course you can. Just use a trigger: >> http://sqlite.org/lang_createtrigger.html Can you show an example of a trigger that would make these statements work:

Re: [sqlite] [newbie] linking two tables with index...

2008-07-01 Thread Mihai Limbasan
Igor Tandetnik wrote: You can't make this happen automatically with SQLite. Hmm? Of course you can. Just use a trigger: http://sqlite.org/lang_createtrigger.html ___ sqlite-users mailing list sqlite-users@sqlite.org