That's what I do, except I put the GET number in a separate table and use a 
Stored Procedure to procure the NEXT number.  It keeps the table with a lot 
of data in it simpler and the table that has the NEXT numbers in it has 
multiple columns but only one row.


----- Original Message ----- 
From: "Dan Goldberg" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, June 25, 2013 4:33 PM
Subject: [RBASE-L] - Re: Assigning Invoice Numbers


:I just use the next function with autonum on the column. It will grab and
: increment the next number.
:
:
: From Help:
:
: (NEXT(tblname,autonumcol))
: Returns the next value of an autonumbered column.
:
: Where colname is an autonumbered column in tblname NEXT returns, and
: increments, the value of the next available autonumber. You cannot use 
this
: function with INSERT, but you can use it with LOAD;NONUM. For example:
: Assume that you have autonumbered the column EmployeeID in the table
: Employees. The highest number currently used in the database is 134. In 
this
: case, in the following example, the value of vNextOne will be 135 and the
: value of vNextTwo will be 136.
:
: Notice that the value has incremented even though no other commands or
: functions were issued.
:
: SET VAR vNextOne = (NEXT(Employees,EmployeeID))
:
: SET VAR vNextTwo = (NEXT(Employees,EmployeeID))
:
: Dan
:
:
: -----Original Message----- 
: From: Les Stark
: Sent: Tuesday, June 25, 2013 10:32 AM
: To: RBASE-L Mailing List
: Subject: [RBASE-L] - Assigning Invoice Numbers
:
: I am having a problem with duplicate invoice numbers.
:   I have a table INVNUM with a column INVNBR that holds an integer
: value for the invoice number.
:   When I create a new invoice,    SET VAR VINV#=INVNBR IN INVNUM to get
: the last invoice number from the table
:      then I increment that number   SET VAR VINV#=(.VINVNBR +
: 1)           the incremented number is used for the current invoice
:      then I update the table               UPDATE INVNUM SET INVNBR=.VINV#
:
:    The table is ready for the next new invoice and the current invoice
: is written with the value of VINV#
: This is a multiple user database and is using Row Locks, Column Verify
: on the tables
: How am I getting duplicate invoice numbers?
: Is there a better way to assign Invoice Numbers?
:
:
: --
:
: 


Reply via email to