85 lines
2.4 KiB
SQL
85 lines
2.4 KiB
SQL
--
|
|
-- $Id$
|
|
--
|
|
-- PDKL#86262 Implementatie Polidirect Klinieken
|
|
-- Inlezen afleveradressen
|
|
--
|
|
DEFINE thisfile = 'PDKL#86262.SQL'
|
|
DEFINE dbuser = '^PDKL'
|
|
|
|
SET ECHO ON
|
|
SET DEFINE ON
|
|
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
|
|
COLUMN fcltcusterr NEW_VALUE fcltcusterr NOPRINT;
|
|
WHENEVER SQLERROR CONTINUE;
|
|
|
|
SELECT adm.getscriptspoolfile ('&thisfile') AS fcltlogfile FROM DUAL;
|
|
|
|
SPOOL &fcltlogfile
|
|
WHENEVER SQLERROR EXIT;
|
|
|
|
SELECT adm.checkscriptcust ('&dbuser') AS fcltcusterr FROM DUAL;
|
|
|
|
WHENEVER SQLERROR CONTINUE;
|
|
PROMPT &fcltcusterr
|
|
SET DEFINE OFF
|
|
|
|
------ payload begin ------
|
|
|
|
DECLARE
|
|
CURSOR c1 IS
|
|
SELECT l.alg_locatie_omschrijving,
|
|
l.alg_locatie_post_adres,
|
|
l.alg_locatie_post_postcode,
|
|
l.alg_locatie_post_plaats,
|
|
l.alg_locatie_post_land,
|
|
l.alg_locatie_adres,
|
|
l.alg_locatie_postcode,
|
|
l.alg_locatie_plaats,
|
|
l.alg_locatie_land
|
|
FROM alg_locatie l;
|
|
BEGIN
|
|
FOR rec IN c1
|
|
LOOP
|
|
BEGIN
|
|
INSERT INTO mld_adres a (a.mld_adres_afleveradres,
|
|
a.mld_adres_naam,
|
|
a.mld_adres_post_adres,
|
|
a.mld_adres_post_postcode,
|
|
a.mld_adres_post_plaats,
|
|
a.mld_adres_post_land,
|
|
a.mld_adres_bezoek_adres,
|
|
a.mld_adres_bezoek_postcode,
|
|
a.mld_adres_bezoek_plaats,
|
|
a.mld_adres_bezoek_land)
|
|
VALUES (1,
|
|
rec.alg_locatie_omschrijving,
|
|
rec.alg_locatie_post_adres,
|
|
rec.alg_locatie_post_postcode,
|
|
rec.alg_locatie_post_plaats,
|
|
rec.alg_locatie_post_land,
|
|
rec.alg_locatie_adres,
|
|
rec.alg_locatie_postcode,
|
|
rec.alg_locatie_plaats,
|
|
rec.alg_locatie_land);
|
|
|
|
COMMIT;
|
|
END;
|
|
END LOOP;
|
|
END;
|
|
/
|
|
|
|
------ payload end ------
|
|
|
|
SET DEFINE OFF
|
|
|
|
BEGIN
|
|
adm.systrackscriptId ('$Id$', 1);
|
|
END;
|
|
/
|
|
|
|
COMMIT;
|
|
SET ECHO OFF
|
|
SPOOL OFF
|
|
SET DEFINE ON
|
|
PROMPT Logfile of this upgrade is: &fcltlogfile |