fecth1.sql
来自「用dephi写的一个银行管理系统」· SQL 代码 · 共 34 行
SQL
34 行
/*取款*/
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 + =
减小字号Ctrl + -
显示快捷键?