declare @yl numeric(11,4)
set @yl=1
exec get_mrpclbomyl '000-HOS-A-001','10WSCA07',@yl output
select @yl
alter procedure get_mrpclbomyl
@cpbh varchar(20),
@clbh varchar(20),
@yl numeric(11,4) output
as
declare @clbhparent varchar(20),@out numeric(11,4)
select @clbhparent=(select isnull(clbhparent,'') from bom where cpbh=@cpbh and clbh=@clbh)
select @out=(select isnull(dwyl,1) from bom where cpbh=@cpbh and clbh=@clbh)
if @clbhparent<>''
begin
exec get_mrpclbomyl @cpbh,@clbhparent,@out output
select @yl=@yl*@out
end
else
select @yl=@yl*@out
return