Update sequence [message #81458] |
Thu, 20 February 2003 03:14 |
Denver
Messages: 1 Registered: February 2003
|
Junior Member |
|
|
A trigger for an update will perform a delete and insert of the specified record. What is the sequence: (a)Insert then delete
or
(b)delete then insert.
My delima:
(a) would imply a duplicate record with a duplicate primary key.
(b) would imply that rollback rules are broken.
|
|
|
Re: Update sequence [message #81459 is a reply to message #81458] |
Thu, 20 February 2003 04:10 |
magnetic
Messages: 324 Registered: January 2003
|
Senior Member |
|
|
a- will result to error [[primary key constraint]]
b- will work:
dont commit after deleting the record
first delete then insert then commit
if things go wrong before commit, rollback will restore the first deleted record and thus rules are not broken.
|
|
|