Home » SQL & PL/SQL » SQL & PL/SQL » Use of Commit after DML statement
Use of Commit after DML statement [message #2756] Mon, 12 August 2002 04:10 Go to next message
Mark Grimshaw
Messages: 73
Registered: June 2002
Member
Hello,

Am I correct in thinking that after a DML insert or delete Sql query on a table I need to use COMMIT for another session to see an up to date picture of the database.

Thanks

Mark Grimshaw
Re: Use of Commit after DML statement [message #2767 is a reply to message #2756] Mon, 12 August 2002 09:36 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Yes - it is one of the fundamentals of a relational database - in order for any changes made in your session to be visible to other sessions, you will need to COMMIT your transaction.
Re: Use of Commit after DML statement [message #2783 is a reply to message #2767] Tue, 13 August 2002 06:05 Go to previous messageGo to next message
Mark Grimshaw
Messages: 73
Registered: June 2002
Member
Thanks,

If using say a DML 'insert' statement and the statement fails would there be an implicit ROLLBACK or would you have to catch an exception and then ROLLBACK via an explicit call.
Re: Use of Commit after DML statement [message #2791 is a reply to message #2767] Tue, 13 August 2002 12:02 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You need to explicitly rollback because there may be other DML statements already processed in your transaction. Depending on the circumstances, you may either want to rollback the entire transaction, or ignore the insert error and continue.
Previous Topic: Re: date range
Next Topic: Summing up data by quarters
Goto Forum:
  


Current Time: Fri Apr 19 11:26:20 CDT 2024