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

QUALITY_CROPFULLNAME_FORAGE

 

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

Параметр

Тип

Описание

CROPID

INTEGER

 

CLASSID

INTEGER

 

SORTID

INTEGER

 

FORAGECROPID

INTEGER

 

FORAGECLASSID

INTEGER

 

USEFULLNAMES

SMALLINT

 

 

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

Параметр

Тип

Описание

CROPFULLNAME

VARCHAR(150)

 

 

Описание

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

 

Определение

CREATE PROCEDURE QUALITY_CROPFULLNAME_FORAGE(
    CROPID INTEGER,
    CLASSID INTEGER,
    SORTID INTEGER,
    FORAGECROPID INTEGER,
    FORAGECLASSID INTEGER,
    USEFULLNAMES SMALLINT)
RETURNS (
    CROPFULLNAME VARCHAR(150))
AS
declare variable TMPNAME varchar(31);
begin
  CROPFULLNAME = '';
  if (CROPID is not null) then begin
    select
      case :USEFULLNAMES
        when 1 then
          CROP.CROPNAME
        else CROP.SHORTCROPNAME
      end
    from CROP
    where (CROP.CROPID = :CROPID)
    into :TMPNAME;
    if (not TMPNAME is  null) then
      CROPFULLNAME = CROPFULLNAME || TMPNAME;
  end

  TMPNAME = null;
  if (CLASSID is not null) then begin
    select
      case :USEFULLNAMES
        when 1 then
          CLASS.CLASSNAME
        else CLASS.SHORTCLASSNAME
      end
    from CLASS
    where CLASS.CLASSID = :CLASSID
    into :TMPNAME;
    if (not TMPNAME is null) then
      CROPFULLNAME = CROPFULLNAME || ' ' || TMPNAME;
  end

  TMPNAME = null;
  if (SORTID is not null) then begin
    select
      case :USEFULLNAMES
        when 1 then
          CROPSORT.SORTNAME
        else CROPSORT.SORTSHORTNAME
      end
    from CROPSORT
    where CROPSORT.SORTID = :SORTID
    into :TMPNAME;
    if (not TMPNAME is null) then
      CROPFULLNAME = CROPFULLNAME || ' ' || TMPNAME;
  end

  TMPNAME = null;
  if (FORAGECROPID is not null) then begin
    select
      case :USEFULLNAMES
        when 1 then
          CROP.CROPNAME
        else CROP.SHORTCROPNAME
      end
    from CROP
    where (CROP.CROPID = :FORAGECROPID)
    into :TMPNAME;
    if (not TMPNAME is  null) then
      CROPFULLNAME = CROPFULLNAME || ' ' || TMPNAME;
  end

  TMPNAME = null;
  if (FORAGECLASSID is not null) then begin
    select
      case :USEFULLNAMES
        when 1 then
          CLASS.CLASSNAME
        else CLASS.SHORTCLASSNAME
      end
    from CLASS
    where (CLASS.CLASSID = :FORAGECLASSID)
    into :TMPNAME;
    if (not TMPNAME is  null) then
      CROPFULLNAME = CROPFULLNAME || ' ' || TMPNAME;
  end

  suspend;

end

 

     Previous topic Chapter index Next topic