> SET VAR vnextnum INTEGER = (NEXT(mytable,nextnumber))
> 
> This work OK, (I always get the next number value) but if I look at the
> table, the value of the record does NOT update to the next number, 

The standard way to use an AUTONUM column is _not_ to call the NEXT() function.
 Whenever you insert a new record in a table, R:Base will take care of making
sure that the new record contains the next number in sequence.  You would never
issue an UPDATE statement against that column, and you don't include it in any
INSERT statements you issue -- it all happens automatically, by R:Base magic.

An _alternative_ way to use the autonumbering system is with the NEXT()
function.  This gives you the next value in the sequence and updates R:Base's
internal counter (in the SYS_DEFAULTS table, if I recall correctly).  If you
pull numbers off this way then yes, it is your responsiblity to put the value
you get in the proper column.
--
Larry

Reply via email to