Benjamin Eckstein
Benjamin Eckstein

Reputation: 894

ROLLBACK ORACLE does not work

I've a very minimalistic script that does not work.

SET TRANSACTION NAME 'anyname';
DELETE FROM V_RECHNUNG WHERE recno=207;
INSERT INTO V_RECHNUNG (recno) VALUES (207);
ROLLBACK;
SELECT * FROM V_RECHNUNG ORDER BY RECNO DESC;

I don't understand why the select statement get an entry with recno 207. In my opinion entry with recno 207 should not exist at all.

Important: I checked that recno 207 did not exist before i run this script.

IS there any oracle server configuration that disables transactions?

Upvotes: 0

Views: 478

Answers (1)

Panayiotis Savva
Panayiotis Savva

Reputation: 131

If your table all ready had an entry for recno 207 before you had done any inserts, or any deletes, then it would make sense :)

Think About it.

You have say the following records:

Point 1: 204, 205, 206, 207, 208

Point 2: You issued the Delete Statement for 207, Hence, you're left with 204, 205, 206, 208

Point 3: You issues the Insert Statement for 207, Hence, you're left with 204, 205, 206, 207, 208

Point 4: You issued a rollback, which will take you back to Point 1.. Ie: you had 207 from the start.

Upvotes: 1

Related Questions