Входные параметры
Параметр | Тип | Описание |
---|---|---|
LOSSRATE |
NUMERIC(5,3) |
|
STEP_LOSS |
INTEGER |
|
STEP_DAYS |
INTEGER |
|
KUKTURE |
INTEGER |
|
Выходные параметры
(Нет выходных параметров)
Описание
(Нет описания для процедуры NIK_INSERT_LOSSES)
Определение
CREATE PROCEDURE NIK_INSERT_LOSSES(
LOSSRATE NUMERIC(5,3),
STEP_LOSS INTEGER,
STEP_DAYS INTEGER,
KUKTURE INTEGER)
AS
DECLARE VARIABLE NEWNUM INTEGER;
DECLARE VARIABLE STORINGDAYS INTEGER;
DECLARE VARIABLE LOSSRAT NUMERIC(5,3);
begin
NewNum = GEN_ID(STORAGELOSSETSIDGEN,1);
select max(storingdays) from storagelossets where storagelossid = :kukture into storingdays;
/*storingdays_ = storingdays + days_step;*/
select max(lossrate) from storagelossets where storagelossid = :kukture into lossrat;
storingdays = storingdays + step_days;
lossrat = lossrat + step_loss * 0.001;
insert into storagelossets (storagelosssetid, storagelossid, storingdays, lossrate) values (:NewNum, :kukture, :storingdays, :lossrate);
/* insert into storagelossets (storagelosssetid, storagelossid, storingdays, lossrate) values (:NewNum, 1, :Storingdays, :Lossrate);
*/end