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

USERS_GET_CURRENT_USER_OBJECTS

 

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

(Нет входных параметров)

 

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

Параметр

Тип

Описание

OBJID

INTEGER

 

OBJPARENTID

INTEGER

 

OBJNAME

VARCHAR(31)

 

CAPTION

VARCHAR(51)

 

OBJCLASSID

INTEGER

 

OBJPARAMS

VARCHAR(255)

 

DESCRIPTION

VARCHAR(255)

 

 

Описание

Развращает список обэктов принадлежащих текущему пользователю

 

Определение

CREATE PROCEDURE USERS_GET_CURRENT_USER_OBJECTS
RETURNS (
    OBJID INTEGER,
    OBJPARENTID INTEGER,
    OBJNAME VARCHAR(31),
    CAPTION VARCHAR(51),
    OBJCLASSID INTEGER,
    OBJPARAMS VARCHAR(255),
    DESCRIPTION VARCHAR(255))
AS
begin
  select OBJECTS.OBJID
    from OBJECTS
    where (OBJECTS.OBJPARAMS = cast((select USERS.USERID
                                       from USERS
                                       where (upper(current_user) = USERS.LOGIN)) as varchar(255)
                                   )
          )
  into :OBJPARENTID;

  for
    select OBJECTS_GET_CHILD.OBJID, OBJECTS_GET_CHILD.OBJCLASSID,
        OBJECTS_GET_CHILD.OBJNAME, OBJECTS_GET_CHILD.CAPTION,
        OBJECTS_GET_CHILD.OBJPARAMS
      from OBJECTS_GET_CHILD(:OBJPARENTID)
    into :OBJID, :OBJCLASSID, :OBJNAME, :CAPTION, :OBJPARAMS
  do
    if (:OBJID is not null) then
      suspend;

  select OBJECTS.OBJID, OBJECTS.OBJCLASSID, OBJECTS.OBJNAME,
      OBJECTS.CAPTION, OBJECTS.OBJPARAMS, OBJECTS.DESCRIPTION
    from OBJECTS
    where (OBJECTS.OBJID = :OBJPARENTID)
  into :OBJID, :OBJCLASSID, :OBJNAME, :CAPTION, :OBJPARAMS, DESCRIPTION;

  suspend;
end

 

     Previous topic Chapter index Next topic