Steve,

 

That is not a true autonumber.

 

If what you want is a set of sequential numbers, then you need to use a
control table to hold the last value, get and increment that value then
store it back to the control table when you perform your add.

 

It sounds as if you are in fact adding a row to the table but then deleting
the row if the action is aborted.

 

In our environment we want, for instance, sequentially-numbered inventory
tickets.  We have a control table with the number.  Here is the sequence of
steps involved:

 

1)      Set a lock on the control table, test to see that the lock was
acquired.  We do this not by actually issuing a table lock in R:BASE, but
using another column on the data row.  That column is normally a 1; to set
the lock we do "update table set column = 0 where column = 1" then test the
R:BASE error variable.  If it succeeded, the user has the "lock."

2)      Retrieve the value from the table, increment it by one and update
the control table with the new value.

3)      Update the control table and set the lock column back to 1.

4)      Insert our record with the sequential number just acquired.

 

Emmitt Dove

Manager, DairyPak Business Systems

Evergreen Packaging, Inc.

[EMAIL PROTECTED]

(203) 214-5683 m

(203) 643-8022 o

(203) 643-8086 f

[EMAIL PROTECTED]

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Breen
Sent: Thursday, November 20, 2008 10:45 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Auto number reset

 

I have a auto number in a column in a table but there are occasions where we
start to add a row to the table and then we do not add the new row, but the
auto number has already been sequenced in the table.

 

Is there any way of resetting this.

 

 

Steve

Reply via email to