Home > database >  After the EXECUTE TRANSACTION count points out that the lack of a COMMIT or ROLLBACK TRANSACTION sta
After the EXECUTE TRANSACTION count points out that the lack of a COMMIT or ROLLBACK TRANSACTION sta

Time:10-05

The
CREATE proc dbo@ bill varchar (20),
@ message varchar (100) the output
As
Set nocount on
The SET XACT_ABORT ON
The BEGIN TRANSACTION

- define the inventory quantity
Declare @ KCSL int, @ 'moom' means' int, @ li_ckdm int
If (@ KCSL & gt; @ 'moom' means')
The begin of the inventory is greater than the number of outbound
The UPDATE G_HWKC SET CPSL=CPSL - @ 'moom' means' the WHERE CKDM=@ li_ckdm;
If (@ @ error & lt;> 0)
The begin
The ROLLBACK TRANSACTION.
The set @ message='change inventory failure!!!!! ';
The return - 1
End
End
The else - inventory shortage
The begin
The set @ message='inventory quantity is not enough,';
The ROLLBACK TRANSACTION.
The return - 1
End

COMMIT
RETURN 1
GO

How to call in the pb

DECLARE sp_sellcheck PROCEDURE FOR test
@ bill=: billbh, @ message=: ls_message OUTPUT;

The EXECUTE sp_sellcheck;

The FETCH sp_sellcheck INTO: ls_message;
The CLOSE sp_sellcheck;

If the stored procedure execution to ROLLBACK the TRANSACTION will appear mistake commit count can be

CodePudding user response:

Insufficient inventory database that if not happened things

CodePudding user response:

There is no answer?

CodePudding user response:

No, for the top

CodePudding user response:

No, for the top
  • Related