SET ECHO ON
SPOOL xaaah#34902.lst
SET DEFINE OFF

DELETE alg_gebouw
 WHERE alg_gebouw_verwijder IS NOT NULL
   AND alg_gebouw_key NOT IN (SELECT alg_gebouw_key FROM alg_verdieping);

DELETE alg_locatie
 WHERE alg_locatie_verwijder IS NOT NULL
   AND alg_locatie_key NOT IN (SELECT alg_locatie_key FROM alg_gebouw);

BEGIN adm.systrackscriptId('$Id$'); END;
/
COMMIT;

SPOOL OFF
SET ECHO OFF