Re: record numbers
- From: RedGrittyBrick <redgrittybrick@xxxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 14:46:46 +0100
Mario wrote:
Maybe my question is stupid and wrong but I hope that you will understand. So, image that you need to create web application which will used by many peoples in one LAN. They processing some documents and every person has the particular number of documents in particular order (1. person has documents from 1 to 100, second from 101 to 200 etc), which process with the particular number (first document -> number 1 in a database). If they all work in a same time, what is the easiest and the most safety way to manage that? Adding number manually is the logical solution but if 2 person put the same number, can they freeze the database or databases are imune on that ?
Many databases allow you to define a column in a table as being "serial". These have their value allocated by the DBMS when you insert a record and are guaranteed to be unique.
Most databases allow you to define that a certain column in a table be "unique". The database will report an error if a second person tries to add a record with the column set to a value that has been already used.
As Roedy suggested, it's almost certainly not a good idea to pre-allocate a fixed range of document numbers to each user. I'd include the user_ID in the "document" table as (say) "author_ID".
.
- Follow-Ups:
- Re: record numbers
- From: Lew
- Re: record numbers
- References:
- record numbers
- From: Mario
- record numbers
- Prev by Date: Re: record numbers
- Next by Date: Re: record numbers
- Previous by thread: Re: record numbers
- Next by thread: Re: record numbers
- Index(es):
Relevant Pages
|
|