Create Sequence on Dual Primary Key
From: Michael Hill <hillmw_at_ram.lmtas.lmco.com>
Date: Fri, 13 Jun 2003 15:01:40 -0500
Message-ID: <3EEA2DA4.56400B61_at_ram.lmtas.lmco.com>
Date: Fri, 13 Jun 2003 15:01:40 -0500
Message-ID: <3EEA2DA4.56400B61_at_ram.lmtas.lmco.com>
If I have a table like:
alter table task add primary key (spec_id, spec_num)
How do i build a seqence?
spec_id is a foreign key to another table
spec_num should be a sequence number within spec_id
examples of spec_id, spec_num combinations:
create table my_table
(
spec_id,
spec_num,
....<snip - other fields>
)
and then create a primary key like:
131, 1
131, 2
131, 3
132, 1
Mike Received on Fri Jun 13 2003 - 22:01:40 CEST