Re: How to explicitly start a transaction

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 15 Nov 1999 13:21:42 -0500
Message-ID: <h04wOKknLWoSkyUd8OESggXcy5Wo_at_4ax.com>


A copy of this was sent to imranh_at_summitdata.com (if that email address didn't require changing) On Mon, 15 Nov 1999 17:48:35 GMT, you wrote:

>In Sybase or MS SQL Server, I can write begin work to explicitly start
>a transaction. I know that Oracle implicitly starts a transaction. My
>front end is using ODBC and that I don't want implicit transactions.
>How do I start a transaction EXPLICITLY using SQL query???
>

begin null; end;

the first statement to modify something starts your transaction. You could probably fake it with a "set transaction" statement:

tkyte_at_8i> update emp set empno = 5;
14 rows updated.

tkyte_at_8i> alter session set isolation_level=read committed; ERROR:
ORA-01453: SET TRANSACTION must be first statement of transaction

tkyte_at_8i> commit;
Commit complete.

tkyte_at_8i> alter session set isolation_level=read committed   2 /

Session altered.

There is no avoiding the implicit transaction.

>Thanks,
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Mon Nov 15 1999 - 19:21:42 CET

Original text of this message