Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/08/2011 06:25 AM, Jay A. Kreibich wrote: > To be more specific, the sqlite_sequence table can be used to find > the lowest sequence number that *may* be assigned. In the same situation as OP I wouldn't bother with trying to find out number

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Nico Williams
On Tue, Mar 8, 2011 at 9:36 AM, Simon Slavin wrote: > Yes.  Is there any reason why you don't use your own sequences instead of > relying on SQLite's functions ?  You could simply use something like > max(id)+1 . Without speaking for the OP, sequences are state that changes when read, thus your

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Simon Slavin
On 8 Mar 2011, at 2:58pm, Nico Williams wrote: > Gaps are OK for nextval, IIUC anyways, but normally they arise out of > write concurrency, which SQLite3 doesn't have. In any case, I would > recommend staying away from sqlite3_sequence and instead of doing > something more complete while still n

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Nico Williams
On Tue, Mar 8, 2011 at 8:25 AM, Jay A. Kreibich wrote: > On Tue, Mar 08, 2011 at 12:01:03AM -0800, Roger Binns scratched on the wall: >> On 03/07/2011 09:53 PM, RAKESH HEMRAJANI wrote: >> > Probleme statement is : >> > I want to implement nextval keyword in sqlite >> >> There are two separate issu

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Nico Williams
On Mon, Mar 7, 2011 at 11:53 PM, RAKESH HEMRAJANI wrote: > I am newbie to sqlite, have started understanding the code, at the moment m > stuck and not able to understand how to generate byte code Depending on how strongly wedded you are to syntax, you might be able to avoid VDBE code generation.

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Jay A. Kreibich
On Tue, Mar 08, 2011 at 12:01:03AM -0800, Roger Binns scratched on the wall: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/07/2011 09:53 PM, RAKESH HEMRAJANI wrote: > > Probleme statement is : > > I want to implement nextval keyword in sqlite > > There are two separate issues here.

Re: [sqlite] Implementing sequence nextval in sqlite

2011-03-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/07/2011 09:53 PM, RAKESH HEMRAJANI wrote: > Probleme statement is : > I want to implement nextval keyword in sqlite There are two separate issues here. One is wanting to know the next rowid that will be assigned which you can find using regular

[sqlite] Implementing sequence nextval in sqlite

2011-03-07 Thread RAKESH HEMRAJANI
Hello experts I am newbie to sqlite, have started understanding the code, at the moment m stuck and not able to understand how to generate byte code Probleme statement is : I want to implement nextval keyword in sqlite E.g Select seq.nextval from employee so o/p should be next available emplo