-- aangepaste settings over alle klanten.
SELECT 'AAAR',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aaar.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AABT',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aabt.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AACE',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aace.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AADO',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aado.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AADS',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aads.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAEN',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aaen.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAES',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aaes.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAFP',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aafp.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAFR',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aafr.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAHU',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aahu.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAIT',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aait.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AALB',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aalb.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAME',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aame.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AANS',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aans.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AANX',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aanx.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAPM',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aapm.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AASA',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aasa.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAVL',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aavl.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAXX',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aaxx.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'AAZC',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM aazc.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
UNION ALL
SELECT 'ASMS',
       fac_setting_module,
       fac_setting_name,
       fac_setting_description,
       fac_setting_default,
       fac_setting_pvalue
  FROM asms.fac_setting s
 WHERE fac_setting_pvalue IS NOT NULL
 
 
 
 DECLARE
   str          VARCHAR2 (400);
   last_login   DATE;
   v_count      NUMBER;
   v_like       VARCHAR2 (100);
BEGIN
   FOR klant IN (SELECT   owner
                   FROM   all_tables
                  WHERE   table_name = 'PRS_PERSLID')
   LOOP
      IF length(klant.owner) = 4
      THEN 
         v_like := chr(39) || '%aa-fm%' || chr(39);
         str :=
         'SELECT count(*)   FROM '|| klant.owner || '.prs_perslid WHERE PRS_PERSLID_OSLOGIN IS NULL AND PRS_PERSLID_OSLOGIN2 IS NOT NULL';

--DBMS_OUTPUT.put_line (str);

         EXECUTE IMMEDIATE str INTO v_count;

         DBMS_OUTPUT.put_line (
            v_count || ' ' || klant.owner
            );
      END IF;
   END LOOP;
END;



declare 
 c_uitvoertijd          mld_stdmelding.mld_stdmelding_t_uitvoertijd%TYPE := MLD_T_UITVOERTIJD(0.0001, 'U');
 
 begin
 update mld_stdmelding set mld_stdmelding_t_uitvoertijd= c_uitvoertijd;
 commit;
 end;