Входные параметры
Параметр | Тип | Описание |
---|---|---|
TRANSPORTNUMBER |
VARCHAR(30) |
|
STATIONNAME |
VARCHAR(30) |
|
OPERATIONNAME |
VARCHAR(100) |
|
OPERATIONID |
INTEGER |
|
PROVIDERNAME |
VARCHAR(30) |
|
OWNERNAME |
VARCHAR(30) |
|
TRANSPORTTYPEID |
INTEGER |
|
Выходные параметры
Параметр | Тип | Описание |
---|---|---|
OWNERPROVIDERNAME |
VARCHAR(100) |
|
OWNERPROVIDERNAME1 |
VARCHAR(100) |
|
OWNERPROVIDERNAME2 |
VARCHAR(100) |
|
OWNERPROVIDERNAME3 |
VARCHAR(100) |
|
OWNERPROVIDERNAME4 |
VARCHAR(100) |
|
Описание
(Нет описания для процедуры FORM36ADATATEXT)
Определение
CREATE PROCEDURE FORM36ADATATEXT(
TRANSPORTNUMBER VARCHAR(30),
STATIONNAME VARCHAR(30),
OPERATIONNAME VARCHAR(100),
OPERATIONID INTEGER,
PROVIDERNAME VARCHAR(30),
OWNERNAME VARCHAR(30),
TRANSPORTTYPEID INTEGER)
RETURNS (
OWNERPROVIDERNAME VARCHAR(100),
OWNERPROVIDERNAME1 VARCHAR(100),
OWNERPROVIDERNAME2 VARCHAR(100),
OWNERPROVIDERNAME3 VARCHAR(100),
OWNERPROVIDERNAME4 VARCHAR(100))
AS
begin
/* Procedure Text */
if (:OPERATIONID in (1,5)) then begin --если приход или отгрузка зерна
if (:TRANSPORTTYPEID in (0,1)) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'АМ - ';
if (:TRANSPORTTYPEID = 2) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'ЖД - ';
if (:TRANSPORTTYPEID = 3) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'ВТ - ';
if (:TRANSPORTTYPEID = 4) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'К - ';
OWNERPROVIDERNAME2 = coalesce(OWNERPROVIDERNAME, '') || :OWNERNAME;
OWNERPROVIDERNAME3 = OWNERPROVIDERNAME2;
OWNERPROVIDERNAME4 = OWNERPROVIDERNAME || ' ' || :PROVIDERNAME;
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || :OWNERNAME || ' ' || :PROVIDERNAME;
OWNERPROVIDERNAME1 = OWNERPROVIDERNAME;
if (:TRANSPORTTYPEID = 2) then begin
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || ' ' || :STATIONNAME;
OWNERPROVIDERNAME4 = coalesce(OWNERPROVIDERNAME4, '') || ' ' || :STATIONNAME;
end
if (:TRANSPORTTYPEID = 3) then begin
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || ' "' || :TRANSPORTNUMBER || '"';
OWNERPROVIDERNAME4 = coalesce(OWNERPROVIDERNAME4, '') || ' "' || :TRANSPORTNUMBER || '"';
end
end
if (:OPERATIONID in (4,7,9,13,17,18,19,22,23,24)) then begin
if (:OPERATIONID in (17)) then
OWNERPROVIDERNAME2 = coalesce(:OPERATIONNAME, '') || ' ' || coalesce(:PROVIDERNAME, '');
if (:OPERATIONID in (22)) then
OWNERPROVIDERNAME2 = coalesce(:OPERATIONNAME, '');
OWNERPROVIDERNAME = coalesce(:OPERATIONNAME, '') || ' ' || coalesce(:OWNERNAME, '') || ' ' || coalesce(:PROVIDERNAME, '');
OWNERPROVIDERNAME1 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME3 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME4 = OWNERPROVIDERNAME2;
end
if (:OPERATIONID in (45,46,71,72)) then begin
OWNERPROVIDERNAME = coalesce(:OPERATIONNAME, '') || ' ' || coalesce(:OWNERNAME, '');
OWNERPROVIDERNAME1 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME2 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME3 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME4 = coalesce(:OPERATIONNAME, '');
end
if (:OPERATIONID = 70) then begin
if (:TRANSPORTTYPEID in (0,1)) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'АМ ';
if (:TRANSPORTTYPEID = 2) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'ЖД ';
if (:TRANSPORTTYPEID = 3) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'ВТ ';
if (:TRANSPORTTYPEID = 4) then
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || 'К - ';
OWNERPROVIDERNAME4 = coalesce(OWNERPROVIDERNAME, '') || coalesce(:OPERATIONNAME, '');
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || coalesce(:OPERATIONNAME, '') || ' ' || coalesce(:OWNERNAME, '');
OWNERPROVIDERNAME1 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME2 = OWNERPROVIDERNAME;
OWNERPROVIDERNAME3 = OWNERPROVIDERNAME;
if (:TRANSPORTTYPEID = 2) then begin
OWNERPROVIDERNAME = coalesce(OWNERPROVIDERNAME, '') || ' ' || coalesce(:STATIONNAME, '');
OWNERPROVIDERNAME4 = coalesce(OWNERPROVIDERNAME4, '') || ' ' || coalesce(:STATIONNAME, '');
end
end
suspend;
end