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

SAMPLER_ORDERLOAD

 

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

Параметр

Тип

Описание

PROVIDERID

INTEGER

 

ORDERDATE

DATE

 

 

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

Параметр

Тип

Описание

QUALITYID

INTEGER

 

CROPID

INTEGER

 

CLASSID

INTEGER

 

CROPCLASSNAME

VARCHAR(150)

 

CLIENTID

INTEGER

 

CLIENTFULLNAME

VARCHAR(100)

 

CROPNAME

VARCHAR(50)

 

CLASSNAME

VARCHAR(50)

 

ORDERLOADID

INTEGER

 

ORDERLOADNUMBER

VARCHAR(20)

 

STORAGEID

INTEGER

 

 

Описание

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

 

Определение

CREATE PROCEDURE SAMPLER_ORDERLOAD(
    PROVIDERID INTEGER,
    ORDERDATE DATE)
RETURNS (
    QUALITYID INTEGER,
    CROPID INTEGER,
    CLASSID INTEGER,
    CROPCLASSNAME VARCHAR(150),
    CLIENTID INTEGER,
    CLIENTFULLNAME VARCHAR(100),
    CROPNAME VARCHAR(50),
    CLASSNAME VARCHAR(50),
    ORDERLOADID INTEGER,
    ORDERLOADNUMBER VARCHAR(20),
    STORAGEID INTEGER)
AS
begin
for
  SELECT orderload.providerid, orderloaditems.qualityid,
    quality_select.cropid, quality_select.classid, clients.clientfullname,
    crop.cropname, class.classname, orderload.orderloadid,
    orderload.ordernumber, orderload.storageid
  FROM orderload
    left join orderloaditems on (orderload.orderloadid = orderloaditems.orderloadid)
    left join quality_select(orderloaditems.qualityid) on (0 = 0)
    LEFT JOIN clients ON (orderload.providerid = clients.clientid)
    LEFT JOIN CROP ON (quality_select.CROPID = CROP.CROPID)
    LEFT JOIN CLASS ON (quality_select.CLASSID = CLASS.CLASSID)
  where (orderload.providerid = :PROVIDERID)
    and (:ORDERDATE between orderload.begindate and orderload.enddate)
    and (orderload.state = 1)

  into
    :CLIENTID, :QUALITYID, :CROPID, :CLASSID, :CLIENTFULLNAME,
    :CROPNAME, :CLASSNAME, :ORDERLOADID, :ORDERLOADNUMBER, :STORAGEID

  do begin
    if ((:CLASSNAME is not null) and (:CROPNAME is not null)) then
      cropclassname = :cropname || '-' || :CLASSNAME;
    if (:CLASSNAME is null) then
      cropclassname = :CROPNAME;
    if (:CROPNAME is null) then
      cropclassname = :CLASSNAME;


  suspend;
end
END

 

     Previous topic Chapter index Next topic