0

I have a problem with the Oracle trigger. There are two tables A & B, and both of them have the incremental field seq_num_a & seq_num_b, and A has a trigger that if insert into A will write the same to B. Now if I insert A table but not commit, and the other one insert A and commit.

Table A
seq_num_A,| byWho
1,        | Me
2,        | Other

I think that B should be

Table B
seq_num_B,| byWho
1,        | Other
2,        | Me

because I commit after the other one, but B still show the value

Table B
seq_num_B,| byWho
1,        | Me
2,        | Other

how can we fix this problem?

1 Answer 1

2

Incremental columns (i.e. columns based on sequences) are assigned their value on INSERT, not on COMMIT. So it is the INSERT order that determines the record ordering, not when those inserts were committed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.