📄 fecth1.sql
字号:
/*取款*/
create procedure fecth1
@type varchar(50),
@no char(13),
@sub1 float,
@date datetime,
@id char(10),
@TT char(10)
as
begin transaction
update bank
set Asset=asset-@sub1
where card_type=@type
if @@Error<>0 goto PRO
update fund_bill
set fortune_amount=fortune_amount+fortune_amount*0.005*datediff(day,deposit_date,getdate())
where card_type=@type and card_no=@no
if @@Error<>0 goto PRO
update Fund_bill
set Fortune_amount=Fortune_amount-@sub1,Deposit_date=@date
where Card_type=@type and Card_no=@no
if @@Error<>0 goto pro
insert into fetch_Depo_log
values(@id,@type,@date,@sub1,@TT)
if @@Error<>0 goto pro
commit transaction
return 0
pro:
Rollback Transaction
return 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -