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

GET_CONTRACT_COSTS_EXP

 

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

Параметр

Тип

Описание

REGDATE

DATE

 

CONTRACTID

INTEGER

 

SERVICEID

INTEGER

 

CROPID

INTEGER

 

CLASSID

INTEGER

 

BUHQUALITYID

INTEGER

 

 

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

Параметр

Тип

Описание

COST

DECIMAL(15,4)

 

CONTRACTCOSTDATE

DATE

 

PRIVILEGEDAYS

INTEGER

 

WEIGHT

INTEGER

 

HUMB

NUMERIC(4,2)

 

DIRTB

NUMERIC(4,2)

 

SCB

NUMERIC(4,2)

 

 

Описание

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

 

Определение

CREATE PROCEDURE GET_CONTRACT_COSTS_EXP(
    REGDATE DATE,
    CONTRACTID INTEGER,
    SERVICEID INTEGER,
    CROPID INTEGER,
    CLASSID INTEGER,
    BUHQUALITYID INTEGER)
RETURNS (
    COST DECIMAL(15,4),
    CONTRACTCOSTDATE DATE,
    PRIVILEGEDAYS INTEGER,
    WEIGHT INTEGER,
    HUMB NUMERIC(4,2),
    DIRTB NUMERIC(4,2),
    SCB NUMERIC(4,2))
AS
declare variable QUALITYID integer;
declare variable FRACTION numeric(4,2);
begin
  select GET_CONTRACT_COSTS.COST, GET_CONTRACT_COSTS.CONTRACTCOSTDATE,
      GET_CONTRACT_COSTS.PRIVILEGEDAYS, GET_CONTRACT_COSTS.WEIGHT,
      GET_CONTRACT_COSTS.QUALITYID, GET_CONTRACT_COSTS.HUMB,
      GET_CONTRACT_COSTS.DIRTB, GET_CONTRACT_COSTS.SCB
    from GET_CONTRACT_COSTS(:REGDATE, :CONTRACTID, :SERVICEID, :CROPID, :CLASSID)
  into :COST, :CONTRACTCOSTDATE, :PRIVILEGEDAYS, :WEIGHT, :QUALITYID, :HUMB, :DIRTB, :SCB;

  if (:SERVICEID = 5) then begin
    for
      select QDATA.QUALITYVALUE
        from CROPPARAMS
          join QUALITYDATA on ((QUALITYDATA.QUALITYID = :QUALITYID)
                               and (QUALITYDATA.QUALITYTYPEID = CROPPARAMS.QUALITYTYPEID))
          join QUALITYDATA QDATA on ((QDATA.QUALITYID = :BUHQUALITYID)
                                     and (QDATA.QUALITYTYPEID = QUALITYDATA.QUALITYTYPEID))
        where ((CROPPARAMS.CROPPARAMTYPEID = 31)
            and (CROPPARAMS.CROPID = -1)
            and (CROPPARAMS.PARENTID = 13))
      into :FRACTION
    do
      DIRTB = coalesce(:DIRTB,0) + coalesce(:FRACTION,0);
  end

  suspend;
end

 

     Previous topic Chapter index Next topic