Many to many relation. How?

Ralf Sander ralf at end-if.de
Tue Dec 7 11:52:06 CST 2004


On 06.12.2004, at 11:38, Ruslan Zasukhin wrote:

> On 12/7/04 12:05 PM, "Ralf Sander" <ralf at end-if.de> wrote:
>
>>> You mean CUSTOM GENERATED values ?
>>> Then you should self generate them.
>> Yes, but how can I produce a serial number, that is really unique?
>> May be a silly question, but how can I prevent, that 2 users create 
>> the
>> same serial? I could use usernames in the id, but the longer the 
>> string
>> the slower operations will be, right?
>
> Note, that it seems only Access and mySQL offer auto-increment.
> Mature dbs such as Sybase do not have them
>
> Develop simple make helper table where keep just 1-2 filed and one or 
> few
> records
>
>         table_id     next_id
>
>         t1           546
>
> So you can get value from this table, increment it, and save back 547
> 546 is the next id for use.
>

Ok, but can I access this via base objects and with many users, will it 
be processed one after another without errs or should I use a r/w 
cursor and write an internal loop to be sure not to get a locked err?

Cheers,
Ralf



More information about the Valentina mailing list