> -----Original Message----- > From: Kai Ponte [mailto:[EMAIL PROTECTED] > Sent: Monday, October 20, 2008 4:48 PM > To: Derby Discussion > Subject: Re: Most efficient way to get max row id? > > On Monday 20 October 2008 08:52:34 am [EMAIL PROTECTED] wrote: > > The table would consist of two columns. A label column and a counter > > column. Your stored procedure has two options. lastVal() and > getNextVal(), > > getNextVal(n). (The last one is optional or could be incrementValTo(n) ) > > I've done this also in the past. It simply keeps track of the last value > of an > inserted item. That way a web page - disconnected recordset - can insert a > new item then another page can grab the information from that item. > > > Yes.
This kind of mimics how Informix's Serial column works or Sybase/Oracle's sequence numbers work. (There's more to it on their part but you can always make this simple thing more advanced.) It's an "older technique" that still has its uses.
