-- -------------------------------------------------------------
-- loadCHECKload_eid.sql:
-- This SQL script is to check the content of the loading layer
--   here: only LOAD_*.entry_id (exept LOAD_ENTRY).
--   It is called from SQL script loadCHECK.sql.
--                                                ft, 1999.07.16
-- -------------------------------------------------------------
-- 1: no NULLS allowed in the _id column
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select distinct 
       1, -999, '...', 'LOAD_&1', 'FATNUL', 'entry_id=NULL found: correct and run loadCHECK again!'
  from  LOAD_&1 where entry_id is NULL;
--
-- 2: only entry_id allowed, if found in master table "LOAD_ENTRY"
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select distinct 
       2, -999, '...', 'LOAD_&1', 'FATILL','entry_id='||entry_id||' not found in table CERA.LOAD_ENTRY'
  from  LOAD_&1 L  where L.entry_id not IN (select entry_id from LOAD_ENTRY);
-- The END of loadCHECKload_eid.sql
