我输入的输入参数不同,所有参数都需要输入不同的表格。因此我使用3种不同的存储过程。从每个存储过程,我需要使用前一个存储过程的输出参数作为输入参数。
这些是我使用的3个存储过程
存储过程1 = Levlotnr:
mkdir -p "${1%/*}" && touch "$1"
存储过程2 = LotIN:
create procedure Levlotnr
(@lotleverancier nvarchar (256),
@leverancier nvarchar (256),
@newinsertedlevID int output)
as
insert into leveranciersLotnr
values (@lotleverancier,
(select leveranciersID
from Leverancier
where LeveranciersNaam = @leverancier) )
select @@IDENTITY as newinsertedlevID
存储过程3 = StockIN:
create procedure LotIN
(@datumIN datetime,
@hoeveelIN decimal,
@grondstofIN nvarchar(256),
@newinsertedLotnrINID int output,
@lotnlevID int)
as
insert into LotnummerIN
values (@datumIN, @hoeveelIN,
(select GrondstofID
from Grondstoffen
where Grondstofomschrijving = @grondstofIN),
@lotnlevID)
select @@IDENTITY as newinsertedLotnrIN
这是我已编写的代码
create procedure StockIN
(@omschrstockIN nvarchar (256),
@lotnrIN int)
as
update StockPlaatsIN
set LotnummerINID = @lotnrIN
where StockINOmschrijving = @omschrstockIN