📄 proc_cancel_po.sql
字号:
if object_id('dbo.Proc_Cancel_PO') is not null
drop procedure dbo.Proc_Cancel_PO
go
Create procedure Proc_Cancel_PO
@Order_Number varchar(30) = NULL,
@Action_type VARCHAR(30) = NULL,
@Action_by varchar(15) = null,
@Reason varchar(250) = null,
@Remark varchar(250) =null
as
begin
if not exists(select order_number from Cancel_po_log where order_number =@order_number)
begin
insert into Cancel_po_log
(
Order_Number,
Action_type,
Action_dt,
Action_by,
Reason,
Remark
)
values
(
@Order_Number,
@Action_type,
getdate(),
@Action_by,
@Reason,
@Remark
)
if(@action_type ='C')
begin
update ord_mst
set status ='C'
where pono = @order_number
end
else if(@action_type ='D')
begin
update ord_mst
set status ='D'
where pono = @order_number
end
else if(@action_type ='A')
begin
update ord_mst
set status ='O'
where pono = @order_number
end
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -