-- -------------------------------------------------------------
-- loadCHECKload_lch.sql:
-- This SQL script is to check the content of the loading layer
--   here: the LOAD_* LOV character fields.
--   It is called from SQL script loadCHECK.sql.
--                                                ft, 1999.07.16
-- -------------------------------------------------------------
-- 1: no NULLS sensibel, in LOAD_&1.&3
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select distinct
       6, L.entry_id, LOAD_ENTRY.entry_acronym, 'LOAD_&1', 'WARNUL', '&3 = NULL is not smart'
  from  LOAD_&1 L, LOAD_ENTRY where L.&3 is NULL and L.entry_id is not NULL 
   and  L.entry_id = LOAD_ENTRY.entry_id;
--
-- 2: item should be in the LOV or in NEW_*
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select distinct 
       7, L.entry_id, LOAD_ENTRY.entry_acronym, 'LOAD_&1' ,'FATILL','&3='||L.&3||' not in table CERA.&2 nor in NEW_&2'
  from  LOAD_&1 L, LOAD_ENTRY
 where  L.&3 not IN (select &3 from     &2)
   and  L.&3 not IN (select &3 from NEW_&2)
   and  L.entry_id = LOAD_ENTRY.entry_id;
-- The end of loadCHECKload_lch.sql
