-- -------------------------------------------------------------
-- loadCHECKnew_nn.sql:
-- This SQL script is to check the content of the loading layer
--   here: tables NEW_*, checking for NULL input
--   It is called from SQL script loadCHECK.sql.
--                                                ft, 1999.07.20
-- -------------------------------------------------------------
-- 1: no NULLs allowed in NEW_*.*_id AND NEW_*.&2
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select 
       29, 0, 'none', 'NEW_&1', 'FATNUL', '&1._id = NULL = &2 found: correct and run loadCHECK again!'
  from  NEW_&1    where    &2 is NULL and &1._id is NULL;
-- -------------------------------------------------------------
-- 2: no NULLs allowed in NEW_*.&2
-- -------------------------------------------------------------
insert into LOAD_ERROR_MESSAGES select 
       30, 0, 'none', 'NEW_&1', 'FATNUL', 'for &1._id=' ||&1._id ||': &2 is NULL'
  from  NEW_&1    where    &2 is NULL and &1._id is not NULL;
-- The END of loadCHECKnew_nn.sql
