Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

nest transaction

2 posts in Windows NT Last posting was on 2000-08-03 08:18:00.0Z
charle Posted on 2000-08-03 03:21:10.0Z
From: "charle" <lhs_cn@sina.com>
Subject: nest transaction
Date: Thu, 3 Aug 2000 11:21:10 +0800
Lines: 84
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <d1rKksP$$GA.203@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: 210.72.245.41
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1779
Article PK: 1089253

Hi,I use nest transaction in my work,but I can NOT rollback the inner
transaction only,the error message is :transaction or savepoint of that name
not found ,so the result is @@trancount not equal to zero in the end of the
program,the test program and result list below:


tablename:aaaa
column:aa int
primary key colum:aa

create proc proc_test
as

begin tran test1
select '1111',@@trancount
insert aaaa values(1)
select * from aaaa
begin tran test2
select '2222',@@trancount
insert aaaa values(2)
select * from aaaa
rollback tran test2
select * from aaaa
select '3333',@@trancount

commit tran test1
select '44444',@@trancount



(2 rows affected)
(1 row affected)
(1 row affected)
Server Message: Number 6401, Severity 16
Line 12:
Cannot rollback test2 - no transaction or savepoint of that name found.
(1 row affected)
(1 row affected)
(1 row affected)
(2 rows affected)
(2 rows affected)
(1 row affected)
(1 row affected)



- -----------
1111 1

aa
-----------
1


- -----------
2222 2

aa
-----------
1
2

aa
-----------
1
2


- -----------
3333 2


- -----------
44444 1


Any help is great!
I expect your solution!
Help me !

charle


"Mark A. Parsons" <pegasys Posted on 2000-08-03 08:18:00.0Z
Message-ID: <39892AB8.F78D951A@_internet.co.nz>
Date: Thu, 03 Aug 2000 20:18:00 +1200
From: "Mark A. Parsons" <pegasys@_internet.co.nz>
Organization: Pegasys (2000) Limited
X-Mailer: Mozilla 4.72 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: nest transaction
References: <d1rKksP$$GA.203@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 12
NNTP-Posting-Host: p417.ipa1-n8-16.iconz.net.nz 210.48.25.161
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:1777
Article PK: 1089247

Check out the sybase.public.sqlserver.general newsgroup for a posting on/around
last Friday titled "What is the scope of savepoints...".

I posted an example that would allow you to do just what you want. The key is
to define a 'save tran <tran_name>' (savepoint) to which you can issue an
intermediate 'rollback tran <tran_name>'.

--
Mark A. Parsons

Iron Horse, Inc. iron_horse@compuserve.com
Pegasys (200), Ltd pegasys@internet.co.nz