Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issue Database

Status
Not open for further replies.

cc5305

MIS
Oct 4, 2000
70
US
I'm new at creating databases in Lotus Notes environment. I'm trying to tweak one of our existing database to have it become an issue database. But the design from the original database lacks a function that auto generates an issue number each time we have an issue, so I need to create a field that can automatically generate a sequential number everytime a new issue is created in the database. Can anyone help me? Thanks.
 
This a mindset thing. In a Domino environment sequential numbers are not really necessary for as many purposes as in an RDBMS.

Assuming that you really need a sequential number, though, it cannot be generated as easily as you might hope.

For this to work, your database cannot be replicated across multiple servers.

1) Create a view sorted in descending order by sequence number.
2) When a new document is created, grab the value in the first column in that view, insert the number into your new document.
3) Save the new document immediately.

This is NOT foolproof. In order to make it foolproof, you need to add a control document, and don't allow anyone to create a new document until they have a lock on the control document, then release control when the number is saved, but it doesn't sound like you are ready for all that.

You can make all these systems work across replicas if you include the server name as a part of a sort of compound primary key.

BTW to get the first value of the first column, do an
@Subset(@DbColumn......; 1)

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top