Select Max(col_xautonum) into vNewNo from my_table; set var vNewNo =
(.vNewNo + 1).   Run this just before your input into your real table.
Perhaps lock the table previously before getting the .vNewNo ( a thought?)
depending on what other people are looking at or using/doing.

 

 

Lock table depends on usage:  'SET LOCK TableName On'

Get next number: Select Max(col_xautonum) into vNewNo from my_table; set var
vNewNo = (.vNewNo + 1).   

Insert/update your data:

Unlock the table: 'SET LOCK TableName On'

 

 

 

Make Profit!

 

 

Paul D.

 

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Roberts,
Jennifer
Sent: Wednesday, December 23, 2009 3:48 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Temporary Tables Question

 

Hello,

 

I am working with version 7.6, build 7.6.8.31102 - and I am wanting to
change the way the users currently add/edit information in this multi-user
database.  I would like to have the users working in temporary tables which
would then update the permanent tables.  Could someone kindly give some
advice on how they have handled primary keys in this situation.  For
example, the user wants to enter a new client.  The client table has a
primary key that is an auto-number.  Is it better to grab the next number
from the permanent table and reserve it or generate the key in the temporary
table and then check to see if it used?  Or is there another way that I
hadn't thought of (most likely  J).  

 

Thank you in advance and Happy Holidays!

 

Jennifer Roberts

Business Applications Specialist

Ohio Masonic Home

Phone:  937.525.3080

Fax:  937.505.4009

Ext:  5788

 


This electronic message contains information 
from the Ohio Masonic Home,
its operating subsidaiaries or affiliates. 
The information may be 
confidential, privileged or otherwise 
protected from disclosure. 
The information is intended to be received 
solely by [email protected], 
for use as designated in the message. If you are not
the designated recipient, you are instructed not to review, 
disclose, copy, distribute orotherwise use of 
this transmission
 or its contents. If you have received this 
transmission in error, please notify the 
Ohio Masonic Home immediately
at [email protected]; in addition, 
please delete your record of 
transmission. Sending, receiving, downloading, displaying,
 printing material that is harassing, fraudulent, offensive, 
intimidating, defamatory, or otherwise
unlawful or inappropriate is strictly prohibited by The Ohio Masonic Home.

 

Reply via email to