Входные параметры
Параметр | Тип | Описание |
---|---|---|
REGNUM |
VARCHAR(10) |
|
HUMIDITY |
NUMERIC(9,2) |
|
DIRT |
NUMERIC(9,2) |
|
SCREENING |
NUMERIC(9,2) |
|
INCOMECOST |
NUMERIC(9,2) |
|
DRYCOST |
NUMERIC(9,2) |
|
UNDERWORKCOST |
NUMERIC(9,2) |
|
Выходные параметры
(Нет выходных параметров)
Описание
(Нет описания для процедуры WRITEINVOICEREGISTERS)
Определение
CREATE PROCEDURE WRITEINVOICEREGISTERS(
REGNUM VARCHAR(10),
HUMIDITY NUMERIC(9,2),
DIRT NUMERIC(9,2),
SCREENING NUMERIC(9,2),
INCOMECOST NUMERIC(9,2),
DRYCOST NUMERIC(9,2),
UNDERWORKCOST NUMERIC(9,2))
AS
DECLARE VARIABLE QUALITYID INTEGER;
begin
for
select invoiceregisters.qualityid from invoiceregisters where invoiceregisters.registernumber = :REGNUM
group by invoiceregisters.qualityid
into :QUALITYID
do
begin
if (:Qualityid is null) then
select Q.resultqualityid from quality_insert(null,null, null,null,null,null,:HUMIDITY,null,null,null, null,null,null,:DIRT,:SCREENING, null,null,null,null,null) Q
into
:QUALITYID;
else
select Q.resultqualityid from quality_update(0,:QUALITYID, null,null,null,null, null,:HUMIDITY,null,null,null, null,null,null,:DIRT,:SCREENING, null,null,null,null) Q
into
:QUALITYID;
update invoiceregisters set invoiceregisters.incomecost = :INCOMECOST, invoiceregisters.drycost = :DRYCOST, invoiceregisters.underworkcost =:UNDERWORKCOST, invoiceregisters.qualityid = :QUALITYID,
invoiceregisters.registernumber = :regnum
where invoiceregisters.registernumber = :REGNUM;
end
end