Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: New Id usign max(id)
mike wrote:
> I don't have a problem with sequence, its just that I'll need to start
> a new sequence for every NUM that happened to be created.
>
> That is not do-able is it? I think I'd just have to have 1 sequence
> and mytable would end up looking like:
>
> NUM ID
> 1 1
> 1 2
> 1 3
> 2 4
> 2 5
> 2 6
>
> Correct?
>
That's my suggestion unless there's some business reason to duplicate
ids. If id has a meaning to your users like line_number within invoice,
then this won't work. If id is something the users don't see then avoid
the multi-column pk and just set up id as a straight sequence.
Received on Thu Oct 06 2005 - 16:54:15 CDT