Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Dan Kennedy
On Oct 23, 2009, at 5:05 AM, Simon Slavin wrote: > I'm looking for assurance that things work the way I think they do, > and will continue to do so in future versions. > > I'm using a TRIGGER that is triggered AFTER INSERT. The INSERT > commands do not know or set the value for the ROWID

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Simon Slavin
On 23 Oct 2009, at 3:00am, D. Richard Hipp wrote: > On Oct 22, 2009, at 9:11 PM, Simon Slavin wrote: >> > >> So now my original query comes down to this: if a column's value is >> generated by SQLite rather than being supplied by my INSERT command, >> i.e. if the column has a is INTEGER PRIMARY

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread D. Richard Hipp
On Oct 22, 2009, at 9:11 PM, Simon Slavin wrote: > > So now my original query comes down to this: if a column's value is > generated by SQLite rather than being supplied by my INSERT command, > i.e. if the column has a is INTEGER PRIMARY KEY, or has a DEFAULT > value, can I rely on being able to

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Simon Slavin
On 23 Oct 2009, at 1:23am, D. Richard Hipp wrote: > On Oct 22, 2009, at 7:11 PM, Igor Tandetnik wrote: >> >> In SQLite, ROWID _is_ the unique identifier for each record. Any >> field declared INTEGER PRIMARY KEY is simply an alias for ROWID. >> "Position in the set", whatever it is, has nothing

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread D. Richard Hipp
On Oct 22, 2009, at 7:11 PM, Igor Tandetnik wrote: > > In SQLite, ROWID _is_ the unique identifier for each record. Any > field declared INTEGER PRIMARY KEY is simply an alias for ROWID. > "Position in the set", whatever it is, has nothing to do with it. A clarification: The ROWID is always

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Igor Tandetnik
Rich Shepard wrote: > On Thu, 22 Oct 2009, Simon Slavin wrote: > >> I'm using a TRIGGER that is triggered AFTER INSERT. The INSERT >> commands do not know or set the value for the ROWID column. Can I >> reliably fetch the value for this column from 'NEW.' ? Or can I

Re: [sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Rich Shepard
On Thu, 22 Oct 2009, Simon Slavin wrote: > I'm using a TRIGGER that is triggered AFTER INSERT. The INSERT commands > do not know or set the value for the ROWID column. Can I reliably fetch > the value for this column from 'NEW.' ? Or can I rely only on values > which are explicitly set in the

[sqlite] Order of operations when using TRIGGERs

2009-10-22 Thread Simon Slavin
I'm looking for assurance that things work the way I think they do, and will continue to do so in future versions. I'm using a TRIGGER that is triggered AFTER INSERT. The INSERT commands do not know or set the value for the ROWID column. Can I reliably fetch the value for this column from