Thanks -- Yes that would work if the table values could not be deleted -- but if the last row were to be deleted it would no longer return the correct value so it is not 100% bulletproof. For example, autonum generates a value of 100 on a row insert, then row numbered 100 is deleted, the calculation would come up with 99+1 (100) but the next autonum row would actually be 101.
If there is no other way, I've found that the next autonum value will be stored in the SYS_DEFAULTS table in the SYS_NEXT column so it would be a matter of identifying appropriate record based on SYS_COLUMN_ID that relates to the table/column in question. I'm only concerned that the SYS_COLUMN_ID if it were to change in the future through DB changes would affect the code to lookup the next value. That's why I was looking for some type of built-in function to return said value. On Tue, Dec 5, 2017 at 5:49 PM, Bruce Chitiea <rby...@safesectors.com> wrote: > SET VAR vNextAutonumID INTEGER = NULL > > SELECT ((MAX(AutonumID)) + 1) + > INTO vNextAutonumID INDICATOR vInd + > FROM Table > > Bruce Chitiea > SafeSectors, Inc. > 909.238.9012 <(909)%20238-9012> m > > ------ Original Message ------ > From: "classicmicro ." <classicmicrosyst...@gmail.com> > To: rbase-l@googlegroups.com > Sent: 12/5/2017 5:45:05 PM > Subject: [RBASE-L] - Determining next autonum value > > Using the statement SET VAR vnext = (NEXT(table,id)) I can determine the > next autonum id number but it also increments the value. > > Is there a way to just determine prior to an INSERT or APPEND what that > value will be without incrementing it? > > Thanks > > -- > For group guidelines, visit http://www.rbase.com/support/ > usersgroup_guidelines.php > --- > You received this message because you are subscribed to the Google Groups > "RBASE-L" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rbase-l+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > -- > For group guidelines, visit http://www.rbase.com/support/ > usersgroup_guidelines.php > --- > You received this message because you are subscribed to the Google Groups > "RBASE-L" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rbase-l+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php --- You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to rbase-l+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.