proc_mtl_where_used.sql
来自「工厂采购系统,DELPHI+SQL SERVER,三层技术」· SQL 代码 · 共 36 行
SQL
36 行
if object_id('dbo.Proc_MTL_Where_Used') is not null
drop procedure dbo.Proc_MTL_Where_Used
go
create procedure Proc_MTL_Where_Used
@hpn varchar(18) = null,
@alt_flag char(1) = null
as
begin
if(@alt_flag='Y')
begin
select a.cust_no as [Customer ID],d.legal_name as [Customer Name],
a.Parentno as [Model Number],c.description as [Model Name],b.mst_item as [HPN],
b.UoM,c.consign_flat as [Consigment Flag]
from merge_mrp.dbo.bas_bom_mainitem a, merge_mrp.dbo.bas_bom_subitem b ,baseitem c,ca_custmstr_hdr d
where a.parentno = b.parentno and a.parentno = c.itemno and a.cust_no = d.cust_num
and a.itemno =@hpn
end
else
begin
select a.cust_no as [Customer ID],d.legal_name as [Customer Name],
a.Parentno as [Model Number],b.description as [Model Name],a.Itemno as [HPN],
a.UoM,b.consign_flat as [Consigment Flag]
from merge_mrp.dbo.bas_bom_mainitem a, baseitem b,ca_custmstr_hdr d
where a.parentno = b.itemno and a.cust_no = d.cust_num
and a.itemno =@hpn
end
end
-- exec Proc_MTL_Where_Used '431503280000-CA001','Y'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?