"localhost:/firebird/data/ILICHEVSK2.FDB". Процедуры Previous topic Chapter index Next topic

IT_AVG_QUALITY_ON_ORDER_ON_SHIP

 

Входные параметры

Параметр

Тип

Описание

ORDERLOADITEMID

INTEGER

 

 

Выходные параметры

Параметр

Тип

Описание

NET

INTEGER

 

DIRT

NUMERIC(9,2)

 

SCREENING

NUMERIC(9,2)

 

HUMIDITY

NUMERIC(9,2)

 

 

Описание

(Нет описания для процедуры IT_AVG_QUALITY_ON_ORDER_ON_SHIP)

 

Определение

CREATE PROCEDURE IT_AVG_QUALITY_ON_ORDER_ON_SHIP(
    ORDERLOADITEMID INTEGER)
RETURNS (
    NET INTEGER,
    DIRT NUMERIC(9,2),
    SCREENING NUMERIC(9,2),
    HUMIDITY NUMERIC(9,2))
AS
begin
  for
    select sum(it.net) net,
      sum(IT.NET * quality_select.dirt) / nullif(sum(IT.NET + quality_select.dirt - quality_select.dirt), 0) dirt,
      sum(IT.NET * quality_select.screening) / nullif(sum(IT.NET + quality_select.screening - quality_select.screening), 0) screening,
      sum(IT.NET * quality_select.humidity) / nullif(sum(IT.NET + quality_select.humidity - quality_select.humidity), 0) humidity
    from it
      left join quality_select(it.labqualityid) on 0 = 0
    where it.orderloaditemid = :orderloaditemid
      and it.operationid = 5
      and it.state = -100
    into :net, :dirt, :screening, :humidity
  do suspend;
end

 

     Previous topic Chapter index Next topic