| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Better to use a Sequence?
Given this hackeneyed example:
create table customer_order (order_id integer, primary key (order_id)); create table customer_order_item (
order_id integer, order_item_id integer, primary key (order_id, order_item_id), foreign key (order_id) references (order) );
insert into customer_order_item (order_id, order_item_id) select 1, max (coalesce(order_item_id, 0)) + 1
from customer_order_item
where order_id = 1;
I found that in a transaction a data race will cause the looser of the race to abort and rollback.
Now I am thinking sequence or order_item_id, but that doesn't *feel* right.
Alan Gutierrez Received on Tue Jan 07 2003 - 15:52:37 CST
![]() |
![]() |