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

AC_GET_TRANSPORTNUMBER

 

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

Параметр

Тип

Описание

QUALITYID

INTEGER

 

INVENTORYID

INTEGER

 

 

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

Параметр

Тип

Описание

TRANSPORTNUMBER

VARCHAR(511)

 

 

Описание

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

 

Определение

CREATE PROCEDURE AC_GET_TRANSPORTNUMBER(
    QUALITYID INTEGER,
    INVENTORYID INTEGER)
RETURNS (
    TRANSPORTNUMBER DVARCHAR511)
AS
declare variable ATRANSPORTNUMBER varchar(31);
declare variable ATRANSPORTTYPEID smallint;
begin
  TRANSPORTNUMBER = 'авто ';

  for
    select ITTRANSPORT.TRANSPORTNUMBER, ITTRANSPORT.TRANSPORTTYPEID
      from IT
        left join ITTRANSPORT on (ITTRANSPORT.INVENTORYID = IT.INVENTORYID)
      where (IT.LABQUALITYID = :QUALITYID)
            and (IT.REGDATE = (select IT.REGDATE
                                 from IT
                                 where (IT.INVENTORYID = :INVENTORYID)
                              )
                )
    order by IT.INVOICEID, ITTRANSPORT.TRANSPORTTYPEID
    into :ATRANSPORTNUMBER, :ATRANSPORTTYPEID

  do begin
    if (:ATRANSPORTTYPEID = 0) then begin
      if (TRANSPORTNUMBER <> 'авто ') then
        TRANSPORTNUMBER = TRANSPORTNUMBER || ',';

      TRANSPORTNUMBER = TRANSPORTNUMBER || ' ' || :ATRANSPORTNUMBER;
    end
    else TRANSPORTNUMBER = TRANSPORTNUMBER || ' / ' || :ATRANSPORTNUMBER;
  end

  suspend;
end

 

     Previous topic Chapter index Next topic