Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: User Sequence Numbers
Matthias Rogel wrote:
> you don't want to update, so you don't need to lock a row
I dont' watn to update - but i want to have exclusive access to the *last* entry in the table (the one with the highest k value).
> lock table foo in exclusive mode;
This would be an overkill. Explanations follows ...
> Oracle noticed that disadvantage and invented sequences.
I' aware of sequences - but this is not exactely what i need. My real problem is a little bit more complicated. Let's assume we have the following two tables:
|--------------|
| parant_table |
| parent_name | <- the key | ... | | | |--------------| | | 1:n |
| parent_name | <- the key | child_nr | <- | ... | | | |--------------|
I want to create unique numbers in table child_table for each parent. The numbers have to unique only for each parent_name:
parent_name child_nr
joe 1 joe 2 joe 3 john 1 john 2 ron 1Received on Fri Jan 31 2003 - 04:59:31 CST
![]() |
![]() |