Входные параметры
Параметр | Тип | Описание |
---|---|---|
UWORDERID |
INTEGER |
|
Выходные параметры
Параметр | Тип | Описание |
---|---|---|
HUMIDITYBEGORE |
NUMERIC(2,2) |
|
HUMIDITYAFTER |
NUMERIC(2,2) |
|
NETSUM |
INTEGER |
|
Описание
Расчет среднего качества (только расчет)
Определение
CREATE PROCEDURE UWORDERS_CALCAVG(
UWORDERID INTEGER)
RETURNS (
HUMIDITYBEGORE NUMERIC(2,2),
HUMIDITYAFTER NUMERIC(2,2),
NETSUM INTEGER)
AS
begin
SELECT
SUM(SampQuality.HUMIDITY*NET) / NULLIF(SUM(NET + SampQuality.HUMIDITY - SampQuality.HUMIDITY), 0),
SUM(LabQuality.HUMIDITY*NET) / NULLIF(SUM(NET + LabQuality.HUMIDITY - LabQuality.HUMIDITY), 0),
SUM(NET)
FROM IT
LEFT JOIN Quality_select(IT.LABQUALITYID) LabQuality ON (0 = 0)
LEFT JOIN Quality_select(IT.SAMPLERQUALITYID) SampQuality ON (0 = 0)
WHERE IT.UWORDERID = :UWORDERID and IT.OPERATIONID <> 9
Into
:HumidityBegore,
:HumidityAfter,
:NetSum;
suspend;
end