begin transaction tt
update sale set status=2 where sno=@sno
if @@error>0 goto ee
update salesum set rsum=@rsum where rno=@no
if @@error>0 goto ee
insert hav (hno,hprice) values(@hno,@hprice)
if @@error>0 goto ee
commit transaction tt
return
ee:
ROLLBACK
update sale set status=2 where sno=@sno
if @@error>0 goto ee
update salesum set rsum=@rsum where rno=@no
if @@error>0 goto ee
insert hav (hno,hprice) values(@hno,@hprice)
if @@error>0 goto ee
commit transaction tt
return
ee:
ROLLBACK
begin transaction tt
update sale set status=2 where sno=@sno
IF @@ERROR<>0 GOTO ERR_HANDLE
update salesum set rsum=@rsum where rno=@no
IF @@ERROR<>0 GOTO ERR_HANDLE
insert hav (hno,hprice) values(@hno,@hprice)
IF @@ERROR<>0 GOTO ERR_HANDLE
commit transaction tt
...
RETRUNERR_HANDLE:
ROLLBACK transaction tt
RETURN
return
end