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

OBJECTS_DELETE

 

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

Параметр

Тип

Описание

OBJID

INTEGER

 

 

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

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

 

Описание

Удаляет объэкт и его зависимости

 

Определение

CREATE PROCEDURE OBJECTS_DELETE(
    OBJID INTEGER)
AS
DECLARE VARIABLE CHILDOBJ INTEGER;
begin
  delete from objects where objid = :Objid ;
  delete from objrelations where objid = :Objid;
  for
    select objrelations.objid from objrelations where objrelations.parentobjid = :objid
    into :childobj
  do begin
    delete from objrelations where ((objid = :childobj) and (parentobjid = :objid));

    if (not(exists (select objid from objrelations where objid = :childobj))) then
      execute procedure objects_delete :childobj;

  end
END

 

     Previous topic Chapter index Next topic