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

WEIGHER_FIND_LAST_TRANSPORT

 

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

Параметр

Тип

Описание

TRANSPORTNUMBER

VARCHAR(31)

 

REGDATE

DATE

 

INVENTORYID

INTEGER

 

 

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

Параметр

Тип

Описание

TARETIME

TIMESTAMP

 

TARE

INTEGER

 

 

Описание

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

 

Определение

CREATE PROCEDURE WEIGHER_FIND_LAST_TRANSPORT(
    TRANSPORTNUMBER VARCHAR(31),
    REGDATE DATE,
    INVENTORYID INTEGER)
RETURNS (
    TARETIME TIMESTAMP,
    TARE INTEGER)
AS
DECLARE VARIABLE LASTINVENTORYID INTEGER;
begin
  LASTINVENTORYID = null;
  select max(ITTRANSPORT.INVENTORYID)
  from ITTRANSPORT
    left join IT on IT.INVENTORYID = ITTRANSPORT.INVENTORYID
  where ITTRANSPORT.TRANSPORTNUMBER = :TRANSPORTNUMBER
    and IT.REGDATE <= :REGDATE
    and IT.INVENTORYID <> :INVENTORYID
    and IT.TARE > 0
  into :LASTINVENTORYID;

  if (:LASTINVENTORYID is not null) then begin
    select TARETIME, TARE
    from IT
    where INVENTORYID = :LASTINVENTORYID
    into :TARETIME, :TARE;

    suspend;
  end
end

 

     Previous topic Chapter index Next topic