I’m guessing you’re connected to Oracle directly and you’re not doing it through a programming language like Java or .NET. That said, we follow it.
You don’t need to get stuck with procedures to declare blocks of code with commits or rollbacks. You can use directly in your preferred SQL IDE. See this example stolen from stackoverflow in English:
begin
statement_zero;
savepoint my_savepoint;
begin
-- if either of these fail, then exception section will be executed
statement_one;
statement_two;
exception
when others then
rollback to my_savepoint;
end;
statement_three;
commit;
end;
But you must be very attentive when you’re making queries that read inserts that you just made but you haven’t done yet commit
of these inserts. Their darlings cannot make these readings because the Oracle does not support Dirty reads, as described below:
Dirty read: The meaning of this term is as bad as it Sounds. You’re
permitted to read Uncommitted, or Dirty , data. You can Achieve this
Effect by just Opening an OS file that someone Else is writing and
Reading whatever data Happens to be there. Data Integrity is
compromised, Foreign Keys are violated, and Unique constraints are
Ignored.
Source: Ask Tom.
I agree with the part that you said that we do not need to be stuck to procedures, maybe the example I gave was not the happiest; but it was what I already had in hand. All right!
– okevinlira