5 Replies Latest reply on Nov 8, 2019 4:04 PM by 4127902

    SQL Developer 18.3 code formatting bug on named arguments

    4127902

      I have a package which no longer compiles after code formatting.

      Screenshot of valid package before formatting:

       

      After CNTRL+F7, the code becomes invalid, because => is splitted into =  and > on a newline. 

       

       

       

      Code of this package:

      create or replace PACKAGE BODY api_adressen

      IS

          ----------------------------------------

          PROCEDURE check_not_null_cols (

              p_adres_id                   IN dal_adressen."ADRES_ID"%TYPE DEFAULT NULL,

              p_straat_id                  IN dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                    IN dal_adressen."HUIS_NR"%TYPE,

              p_bus                        IN dal_adressen."BUS"%TYPE,

              p_gemeente_id                IN dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                     IN dal_adressen."STRAAT"%TYPE,

              p_bericht                    IN dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                IN dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                     IN dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht            IN dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                 IN dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                 IN dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind         IN dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind       IN dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind   IN dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind        IN dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind          IN dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                        IN dal_adressen."TAV"%TYPE,

              p_referentie_soort           IN dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id              IN dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                    IN dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland           IN dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                    IN dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind             IN dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                     IN dal_adressen."WEV_ID"%TYPE,

              p_x                          IN dal_adressen."X"%TYPE,

              p_y                          IN dal_adressen."Y"%TYPE,

              p_factzorgen_ind             IN dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id          IN dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind          IN dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind           IN dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                 IN dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id     IN dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres     IN dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                     IN dal_adressen."E_MAIL"%TYPE)

          IS

          BEGIN

              fw.assert (p_referentie_soort IS NOT NULL,

                         'null waarde kan niet voor REFERENTIE_SOORT');

              fw.assert (p_facturatieadres_ind IS NOT NULL,

                         'null waarde kan niet voor FACTURATIEADRES_IND');

              fw.assert (p_verzorgingsadres_ind IS NOT NULL,

                         'null waarde kan niet voor VERZORGINGSADRES_IND');

              fw.assert (p_correspondentieadres_ind IS NOT NULL,

                         'null waarde kan niet voor CORRESPONDENTIEADRES_IND');

              fw.assert (p_factzorgen_ind IS NOT NULL,

                         'null waarde kan niet voor FACTZORGEN_IND');

              fw.assert (p_verwijderd_ind IS NOT NULL,

                         'null waarde kan niet voor VERWIJDERD_IND');

              fw.assert (p_land_cd IS NOT NULL,

                         'null waarde kan niet voor LAND_CD');

              fw.assert (p_fin_rekening_ind IS NOT NULL,

                         'null waarde kan niet voor FIN_REKENING_IND');

              fw.assert (p_praktijkadres_ind IS NOT NULL,

                         'null waarde kan niet voor PRAKTIJKADRES_IND');

              fw.assert (p_in_gebruik IS NOT NULL,

                         'null waarde kan niet voor IN_GEBRUIK');

              fw.assert (p_verblijfadres_ind IS NOT NULL,

                         'null waarde kan niet voor VERBLIJFADRES_IND');

              fw.assert (p_domicilieadres_ind IS NOT NULL,

                         'null waarde kan niet voor DOMICILIEADRES_IND');

              NULL;

          END check_not_null_cols;

       

       

          PROCEDURE check_not_null_cols (p_row IN dal_adressen%ROWTYPE)

          IS

          BEGIN

              fw.assert (p_row.referentie_soort IS NOT NULL,

                         'null waarde kan niet voor REFERENTIE_SOORT');

              fw.assert (p_row.facturatieadres_ind IS NOT NULL,

                         'null waarde kan niet voor FACTURATIEADRES_IND');

              fw.assert (p_row.verzorgingsadres_ind IS NOT NULL,

                         'null waarde kan niet voor VERZORGINGSADRES_IND');

              fw.assert (p_row.correspondentieadres_ind IS NOT NULL,

                         'null waarde kan niet voor CORRESPONDENTIEADRES_IND');

              fw.assert (p_row.factzorgen_ind IS NOT NULL,

                         'null waarde kan niet voor FACTZORGEN_IND');

              fw.assert (p_row.verwijderd_ind IS NOT NULL,

                         'null waarde kan niet voor VERWIJDERD_IND');

              fw.assert (p_row.land_cd IS NOT NULL,

                         'null waarde kan niet voor LAND_CD');

              fw.assert (p_row.fin_rekening_ind IS NOT NULL,

                         'null waarde kan niet voor FIN_REKENING_IND');

              fw.assert (p_row.praktijkadres_ind IS NOT NULL,

                         'null waarde kan niet voor PRAKTIJKADRES_IND');

              fw.assert (p_row.in_gebruik IS NOT NULL,

                         'null waarde kan niet voor IN_GEBRUIK');

              fw.assert (p_row.verblijfadres_ind IS NOT NULL,

                         'null waarde kan niet voor VERBLIJFADRES_IND');

              fw.assert (p_row.domicilieadres_ind IS NOT NULL,

                         'null waarde kan niet voor DOMICILIEADRES_IND');

              NULL;

          END check_not_null_cols;

       

       

          ----------------------------------------

          PROCEDURE check_foreign_keys (

              p_adres_id                   IN dal_adressen."ADRES_ID"%TYPE DEFAULT NULL,

              p_straat_id                  IN dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                    IN dal_adressen."HUIS_NR"%TYPE,

              p_bus                        IN dal_adressen."BUS"%TYPE,

              p_gemeente_id                IN dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                     IN dal_adressen."STRAAT"%TYPE,

              p_bericht                    IN dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                IN dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                     IN dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht            IN dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                 IN dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                 IN dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind         IN dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind       IN dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind   IN dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind        IN dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind          IN dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                        IN dal_adressen."TAV"%TYPE,

              p_referentie_soort           IN dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id              IN dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                    IN dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland           IN dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                    IN dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind             IN dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                     IN dal_adressen."WEV_ID"%TYPE,

              p_x                          IN dal_adressen."X"%TYPE,

              p_y                          IN dal_adressen."Y"%TYPE,

              p_factzorgen_ind             IN dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id          IN dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind          IN dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind           IN dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                 IN dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id     IN dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres     IN dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                     IN dal_adressen."E_MAIL"%TYPE)

          IS

              l_cnt   PLS_INTEGER;

          BEGIN

              IF p_verblijfplaats_id IS NOT NULL

              THEN

                  SELECT COUNT (verblijfplaats_id)

                  INTO l_cnt

                  FROM fact_verblijfplaatsen

                  WHERE verblijfplaats_id = p_verblijfplaats_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                         'ongeldige key FACT_VERBLIJFPLAATSEN('

                      || p_verblijfplaats_id

                      || ')',

                      'AFDA_ADRESSEN.VERBLIJFPLAATS_ID -> FACT_VERBLIJFPLAATSEN.VERBLIJFPLAATS_ID');

              END IF;

       

       

              IF p_camping_id IS NOT NULL

              THEN

                  SELECT COUNT (camping_id)

                  INTO l_cnt

                  FROM afda_campings

                  WHERE camping_id = p_camping_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key AFDA_CAMPINGS(' || p_camping_id || ')',

                      'AFDA_ADRESSEN.CAMPING_ID -> AFDA_CAMPINGS.CAMPING_ID');

              END IF;

       

       

              IF p_gemeente_id IS NOT NULL

              THEN

                  SELECT COUNT (gemeente_id)

                  INTO l_cnt

                  FROM afda_gemeentes

                  WHERE gemeente_id = p_gemeente_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key AFDA_GEMEENTES(' || p_gemeente_id || ')',

                      'AFDA_ADRESSEN.GEMEENTE_ID -> AFDA_GEMEENTES.GEMEENTE_ID');

              END IF;

       

       

              IF p_straat_id IS NOT NULL

              THEN

                  SELECT COUNT (straat_id)

                  INTO l_cnt

                  FROM afda_straten

                  WHERE straat_id = p_straat_id;

       

       

                  fw.assert (l_cnt > 0,

                             'ongeldige key AFDA_STRATEN(' || p_straat_id || ')',

                             'AFDA_ADRESSEN.STRAAT_ID -> AFDA_STRATEN.STRAAT_ID');

              END IF;

       

       

              IF p_wev_id IS NOT NULL

              THEN

                  SELECT COUNT (version_id)

                  INTO l_cnt

                  FROM wgk_entity_versions

                  WHERE version_id = p_wev_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key WGK_ENTITY_VERSIONS(' || p_wev_id || ')',

                      'AFDA_ADRESSEN.WEV_ID -> WGK_ENTITY_VERSIONS.VERSION_ID');

              END IF;

       

       

              IF p_land_cd IS NOT NULL

              THEN

                  SELECT COUNT (code)

                  INTO l_cnt

                  FROM pers_ss_landen

                  WHERE code = p_land_cd;

       

       

                  fw.assert (l_cnt > 0,

                             'ongeldige key PERS_SS_LANDEN(' || p_land_cd || ')',

                             'AFDA_ADRESSEN.LAND_CD -> PERS_SS_LANDEN.CODE');

              END IF;

       

       

              NULL;

          END check_foreign_keys;

       

       

          ----------------------------------------

          PROCEDURE check_foreign_keys (p_row IN dal_adressen%ROWTYPE)

          IS

              l_cnt   PLS_INTEGER;

          BEGIN

              IF p_row.verblijfplaats_id IS NOT NULL

              THEN

                  SELECT COUNT (verblijfplaats_id)

                  INTO l_cnt

                  FROM fact_verblijfplaatsen

                  WHERE verblijfplaats_id = p_row.verblijfplaats_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                         'ongeldige key FACT_VERBLIJFPLAATSEN('

                      || p_row.verblijfplaats_id

                      || ')',

                      'AFDA_ADRESSEN.VERBLIJFPLAATS_ID -> FACT_VERBLIJFPLAATSEN.VERBLIJFPLAATS_ID');

              END IF;

       

       

              IF p_row.camping_id IS NOT NULL

              THEN

                  SELECT COUNT (camping_id)

                  INTO l_cnt

                  FROM afda_campings

                  WHERE camping_id = p_row.camping_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key AFDA_CAMPINGS(' || p_row.camping_id || ')',

                      'AFDA_ADRESSEN.CAMPING_ID -> AFDA_CAMPINGS.CAMPING_ID');

              END IF;

       

       

              IF p_row.gemeente_id IS NOT NULL

              THEN

                  SELECT COUNT (gemeente_id)

                  INTO l_cnt

                  FROM afda_gemeentes

                  WHERE gemeente_id = p_row.gemeente_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key AFDA_GEMEENTES(' || p_row.gemeente_id || ')',

                      'AFDA_ADRESSEN.GEMEENTE_ID -> AFDA_GEMEENTES.GEMEENTE_ID');

              END IF;

       

       

              IF p_row.straat_id IS NOT NULL

              THEN

                  SELECT COUNT (straat_id)

                  INTO l_cnt

                  FROM afda_straten

                  WHERE straat_id = p_row.straat_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key AFDA_STRATEN(' || p_row.straat_id || ')',

                      'AFDA_ADRESSEN.STRAAT_ID -> AFDA_STRATEN.STRAAT_ID');

              END IF;

       

       

              IF p_row.wev_id IS NOT NULL

              THEN

                  SELECT COUNT (version_id)

                  INTO l_cnt

                  FROM wgk_entity_versions

                  WHERE version_id = p_row.wev_id;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key WGK_ENTITY_VERSIONS(' || p_row.wev_id || ')',

                      'AFDA_ADRESSEN.WEV_ID -> WGK_ENTITY_VERSIONS.VERSION_ID');

              END IF;

       

       

              IF p_row.land_cd IS NOT NULL

              THEN

                  SELECT COUNT (code)

                  INTO l_cnt

                  FROM pers_ss_landen

                  WHERE code = p_row.land_cd;

       

       

                  fw.assert (

                      l_cnt > 0,

                      'ongeldige key PERS_SS_LANDEN(' || p_row.land_cd || ')',

                      'AFDA_ADRESSEN.LAND_CD -> PERS_SS_LANDEN.CODE');

              END IF;

       

       

              NULL;

          END check_foreign_keys;

       

       

          ----------------------------------------

          FUNCTION row_exists (p_adres_id IN dal_adressen."ADRES_ID"%TYPE)

              RETURN BOOLEAN

          IS

              l_count   PLS_INTEGER;

          BEGIN

              SELECT COUNT (adres_id)

              INTO l_count

              FROM afda_adressen

              WHERE "ADRES_ID" = p_adres_id;

       

       

              RETURN l_count <> 0;

          END;

       

       

          ----------------------------------------

          FUNCTION row_exists_yn (p_adres_id IN dal_adressen."ADRES_ID"%TYPE)

              RETURN VARCHAR2

          IS

          BEGIN

              RETURN CASE

                         WHEN row_exists (p_adres_id => p_adres_id) THEN 'Y'

                         ELSE 'N'

                     END;

          END;

       

       

          ----------------------------------------

          FUNCTION create_row (

              p_adres_id                   IN dal_adressen."ADRES_ID"%TYPE DEFAULT NULL,

              p_straat_id                  IN dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                    IN dal_adressen."HUIS_NR"%TYPE,

              p_bus                        IN dal_adressen."BUS"%TYPE,

              p_gemeente_id                IN dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                     IN dal_adressen."STRAAT"%TYPE,

              p_bericht                    IN dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                IN dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                     IN dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht            IN dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                 IN dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                 IN dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind         IN dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind       IN dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind   IN dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind        IN dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind          IN dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                        IN dal_adressen."TAV"%TYPE,

              p_referentie_soort           IN dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id              IN dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                    IN dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland           IN dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                    IN dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind             IN dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                     IN dal_adressen."WEV_ID"%TYPE,

              p_x                          IN dal_adressen."X"%TYPE,

              p_y                          IN dal_adressen."Y"%TYPE,

              p_factzorgen_ind             IN dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id          IN dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind          IN dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind           IN dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                 IN dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id     IN dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres     IN dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                     IN dal_adressen."E_MAIL"%TYPE)

              RETURN dal_adressen%ROWTYPE

          IS

              v_row   dal_adressen%ROWTYPE;

              v_pk    afda_adressen."ADRES_ID"%TYPE;

          BEGIN

              IF p_adres_id IS NULL

              THEN

                  v_pk := adres_id.NEXTVAL;

              ELSE

                  v_pk := p_adres_id;

              END IF;

       

       

              IF v_pk IS NOT NULL

              THEN

                  check_not_null_cols (

                      p_adres_id                   => v_pk,

                      p_straat_id                  => p_straat_id,

                      p_huis_nr                    => p_huis_nr,

                      p_bus                        => p_bus,

                      p_gemeente_id                => p_gemeente_id,

                      p_straat                     => p_straat,

                      p_bericht                    => p_bericht,

                      p_telefoon_nr                => p_telefoon_nr,

                      p_fax_nr                     => p_fax_nr,

                      p_sleutel_bericht            => p_sleutel_bericht,

                      p_camping_id                 => p_camping_id,

                      p_in_gebruik                 => p_in_gebruik,

                      p_domicilieadres_ind         => p_domicilieadres_ind,

                      p_verzorgingsadres_ind       => p_verzorgingsadres_ind,

                      p_correspondentieadres_ind   => p_correspondentieadres_ind,

                      p_facturatieadres_ind        => p_facturatieadres_ind,

                      p_praktijkadres_ind          => p_praktijkadres_ind,

                      p_tav                        => p_tav,

                      p_referentie_soort           => p_referentie_soort,

                      p_referentie_id              => p_referentie_id,

                      p_land_cd                    => p_land_cd,

                      p_adres_buitenland           => p_adres_buitenland,

                      p_volg_nr                    => p_volg_nr,

                      p_verwijderd_ind             => p_verwijderd_ind,

                      p_wev_id                     => p_wev_id,

                      p_x                          => p_x,

                      p_y                          => p_y,

                      p_factzorgen_ind             => p_factzorgen_ind,

                      p_verblijfplaats_id          => p_verblijfplaats_id,

                      p_verblijfadres_ind          => p_verblijfadres_ind,

                      p_fin_rekening_ind           => p_fin_rekening_ind,

                      p_patient_nr                 => p_patient_nr,

                      p_vervangendoor_adres_id     => p_vervangendoor_adres_id,

                      p_reden_onvolledig_adres     => p_reden_onvolledig_adres,

                      p_e_mail                     => p_e_mail);

                  check_foreign_keys (

                      p_adres_id                   => v_pk,

                      p_straat_id                  => p_straat_id,

                      p_huis_nr                    => p_huis_nr,

                      p_bus                        => p_bus,

                      p_gemeente_id                => p_gemeente_id,

                      p_straat                     => p_straat,

                      p_bericht                    => p_bericht,

                      p_telefoon_nr                => p_telefoon_nr,

                      p_fax_nr                     => p_fax_nr,

                      p_sleutel_bericht            => p_sleutel_bericht,

                      p_camping_id                 => p_camping_id,

                      p_in_gebruik                 => p_in_gebruik,

                      p_domicilieadres_ind         => p_domicilieadres_ind,

                      p_verzorgingsadres_ind       => p_verzorgingsadres_ind,

                      p_correspondentieadres_ind   => p_correspondentieadres_ind,

                      p_facturatieadres_ind        => p_facturatieadres_ind,

                      p_praktijkadres_ind          => p_praktijkadres_ind,

                      p_tav                        => p_tav,

                      p_referentie_soort           => p_referentie_soort,

                      p_referentie_id              => p_referentie_id,

                      p_land_cd                    => p_land_cd,

                      p_adres_buitenland           => p_adres_buitenland,

                      p_volg_nr                    => p_volg_nr,

                      p_verwijderd_ind             => p_verwijderd_ind,

                      p_wev_id                     => p_wev_id,

                      p_x                          => p_x,

                      p_y                          => p_y,

                      p_factzorgen_ind             => p_factzorgen_ind,

                      p_verblijfplaats_id          => p_verblijfplaats_id,

                      p_verblijfadres_ind          => p_verblijfadres_ind,

                      p_fin_rekening_ind           => p_fin_rekening_ind,

                      p_patient_nr                 => p_patient_nr,

                      p_vervangendoor_adres_id     => p_vervangendoor_adres_id,

                      p_reden_onvolledig_adres     => p_reden_onvolledig_adres,

                      p_e_mail                     => p_e_mail);

       

       

                  INSERT INTO afda_adressen ("ADRES_ID",

                                             "STRAAT_ID",

                                             "HUIS_NR",

                                             "BUS",

                                             "GEMEENTE_ID",

                                             "STRAAT",

                                             "BERICHT",

                                             "TELEFOON_NR",

                                             "FAX_NR",

                                             "SLEUTEL_BERICHT",

                                             "CAMPING_ID",

                                             "IN_GEBRUIK",

                                             "DOMICILIEADRES_IND",

                                             "VERZORGINGSADRES_IND",

                                             "CORRESPONDENTIEADRES_IND",

                                             "FACTURATIEADRES_IND",

                                             "PRAKTIJKADRES_IND",

                                             "TAV",

                                             "REFERENTIE_SOORT",

                                             "REFERENTIE_ID",

                                             "LAND_CD",

                                             "ADRES_BUITENLAND",

                                             "VOLG_NR",

                                             "VERWIJDERD_IND",

                                             "WEV_ID",

                                             "X",

                                             "Y",

                                             "FACTZORGEN_IND",

                                             "VERBLIJFPLAATS_ID",

                                             "VERBLIJFADRES_IND",

                                             "FIN_REKENING_IND",

                                             "PATIENT_NR",

                                             "VERVANGENDOOR_ADRES_ID",

                                             "REDEN_ONVOLLEDIG_ADRES",

                                             "E_MAIL",

                                             "CREATIE_USER",

                                             "CREATIE_DT")

                  VALUES (v_pk,

                          p_straat_id,

                          p_huis_nr,

                          p_bus,

                          p_gemeente_id,

                          p_straat,

                          p_bericht,

                          p_telefoon_nr,

                          p_fax_nr,

                          p_sleutel_bericht,

                          p_camping_id,

                          p_in_gebruik,

                          p_domicilieadres_ind,

                          p_verzorgingsadres_ind,

                          p_correspondentieadres_ind,

                          p_facturatieadres_ind,

                          p_praktijkadres_ind,

                          p_tav,

                          p_referentie_soort,

                          p_referentie_id,

                          p_land_cd,

                          p_adres_buitenland,

                          p_volg_nr,

                          p_verwijderd_ind,

                          p_wev_id,

                          p_x,

                          p_y,

                          p_factzorgen_ind,

                          p_verblijfplaats_id,

                          p_verblijfadres_ind,

                          p_fin_rekening_ind,

                          p_patient_nr,

                          p_vervangendoor_adres_id,

                          p_reden_onvolledig_adres,

                          p_e_mail,

                          fw.utils.wijziging_user,

                          fw.utils.wijziging_dt)

                  RETURN "ADRES_ID",

                         "STRAAT_ID",

                         "HUIS_NR",

                         "BUS",

                         "GEMEENTE_ID",

                         "STRAAT",

                         "BERICHT",

                         "TELEFOON_NR",

                         "FAX_NR",

                         "SLEUTEL_BERICHT",

                         "CAMPING_ID",

                         "IN_GEBRUIK",

                         "DOMICILIEADRES_IND",

                         "VERZORGINGSADRES_IND",

                         "CORRESPONDENTIEADRES_IND",

                         "FACTURATIEADRES_IND",

                         "PRAKTIJKADRES_IND",

                         "TAV",

                         "REFERENTIE_SOORT",

                         "REFERENTIE_ID",

                         "LAND_CD",

                         "ADRES_BUITENLAND",

                         "VOLG_NR",

                         "VERWIJDERD_IND",

                         "WEV_ID",

                         "X",

                         "Y",

                         "FACTZORGEN_IND",

                         "VERBLIJFPLAATS_ID",

                         "VERBLIJFADRES_IND",

                         "FIN_REKENING_IND",

                         "PATIENT_NR",

                         "VERVANGENDOOR_ADRES_ID",

                         "REDEN_ONVOLLEDIG_ADRES",

                         "E_MAIL",

                         "CREATIE_USER",

                         "CREATIE_DT",

                         "WIJZIGING_USER",

                         "WIJZIGING_DT"

                  INTO v_row."ADRES_ID",

                       v_row."STRAAT_ID",

                       v_row."HUIS_NR",

                       v_row."BUS",

                       v_row."GEMEENTE_ID",

                       v_row."STRAAT",

                       v_row."BERICHT",

                       v_row."TELEFOON_NR",

                       v_row."FAX_NR",

                       v_row."SLEUTEL_BERICHT",

                       v_row."CAMPING_ID",

                       v_row."IN_GEBRUIK",

                       v_row."DOMICILIEADRES_IND",

                       v_row."VERZORGINGSADRES_IND",

                       v_row."CORRESPONDENTIEADRES_IND",

                       v_row."FACTURATIEADRES_IND",

                       v_row."PRAKTIJKADRES_IND",

                       v_row."TAV",

                       v_row."REFERENTIE_SOORT",

                       v_row."REFERENTIE_ID",

                       v_row."LAND_CD",

                       v_row."ADRES_BUITENLAND",

                       v_row."VOLG_NR",

                       v_row."VERWIJDERD_IND",

                       v_row."WEV_ID",

                       v_row."X",

                       v_row."Y",

                       v_row."FACTZORGEN_IND",

                       v_row."VERBLIJFPLAATS_ID",

                       v_row."VERBLIJFADRES_IND",

                       v_row."FIN_REKENING_IND",

                       v_row."PATIENT_NR",

                       v_row."VERVANGENDOOR_ADRES_ID",

                       v_row."REDEN_ONVOLLEDIG_ADRES",

                       v_row."E_MAIL",

                       v_row."CREATIE_USER",

                       v_row."CREATIE_DT",

                       v_row."WIJZIGING_USER",

                       v_row."WIJZIGING_DT";

              ELSE

                  check_not_null_cols (

                      p_straat_id                  => p_straat_id,

                      p_huis_nr                    => p_huis_nr,

                      p_bus                        => p_bus,

                      p_gemeente_id                => p_gemeente_id,

                      p_straat                     => p_straat,

                      p_bericht                    => p_bericht,

                      p_telefoon_nr                => p_telefoon_nr,

                      p_fax_nr                     => p_fax_nr,

                      p_sleutel_bericht            => p_sleutel_bericht,

                      p_camping_id                 => p_camping_id,

                      p_in_gebruik                 => p_in_gebruik,

                      p_domicilieadres_ind         => p_domicilieadres_ind,

                      p_verzorgingsadres_ind       => p_verzorgingsadres_ind,

                      p_correspondentieadres_ind   => p_correspondentieadres_ind,

                      p_facturatieadres_ind        => p_facturatieadres_ind,

                      p_praktijkadres_ind          => p_praktijkadres_ind,

                      p_tav                        => p_tav,

                      p_referentie_soort           => p_referentie_soort,

                      p_referentie_id              => p_referentie_id,

                      p_land_cd                    => p_land_cd,

                      p_adres_buitenland           => p_adres_buitenland,

                      p_volg_nr                    => p_volg_nr,

                      p_verwijderd_ind             => p_verwijderd_ind,

                      p_wev_id                     => p_wev_id,

                      p_x                          => p_x,

                      p_y                          => p_y,

                      p_factzorgen_ind             => p_factzorgen_ind,

                      p_verblijfplaats_id          => p_verblijfplaats_id,

                      p_verblijfadres_ind          => p_verblijfadres_ind,

                      p_fin_rekening_ind           => p_fin_rekening_ind,

                      p_patient_nr                 => p_patient_nr,

                      p_vervangendoor_adres_id     => p_vervangendoor_adres_id,

                      p_reden_onvolledig_adres     => p_reden_onvolledig_adres,

                      p_e_mail                     => p_e_mail);

                  check_foreign_keys (

                      p_straat_id                  => p_straat_id,

                      p_huis_nr                    => p_huis_nr,

                      p_bus                        => p_bus,

                      p_gemeente_id                => p_gemeente_id,

                      p_straat                     => p_straat,

                      p_bericht                    => p_bericht,

                      p_telefoon_nr                => p_telefoon_nr,

                      p_fax_nr                     => p_fax_nr,

                      p_sleutel_bericht            => p_sleutel_bericht,

                      p_camping_id                 => p_camping_id,

                      p_in_gebruik                 => p_in_gebruik,

                      p_domicilieadres_ind         => p_domicilieadres_ind,

                      p_verzorgingsadres_ind       => p_verzorgingsadres_ind,

                      p_correspondentieadres_ind   => p_correspondentieadres_ind,

                      p_facturatieadres_ind        => p_facturatieadres_ind,

                      p_praktijkadres_ind          => p_praktijkadres_ind,

                      p_tav                        => p_tav,

                      p_referentie_soort           => p_referentie_soort,

                      p_referentie_id              => p_referentie_id,

                      p_land_cd                    => p_land_cd,

                      p_adres_buitenland           => p_adres_buitenland,

                      p_volg_nr                    => p_volg_nr,

                      p_verwijderd_ind             => p_verwijderd_ind,

                      p_wev_id                     => p_wev_id,

                      p_x                          => p_x,

                      p_y                          => p_y,

                      p_factzorgen_ind             => p_factzorgen_ind,

                      p_verblijfplaats_id          => p_verblijfplaats_id,

                      p_verblijfadres_ind          => p_verblijfadres_ind,

                      p_fin_rekening_ind           => p_fin_rekening_ind,

                      p_patient_nr                 => p_patient_nr,

                      p_vervangendoor_adres_id     => p_vervangendoor_adres_id,

                      p_reden_onvolledig_adres     => p_reden_onvolledig_adres,

                      p_e_mail                     => p_e_mail);

       

       

                  INSERT INTO afda_adressen ("STRAAT_ID",

                                             "HUIS_NR",

                                             "BUS",

                                             "GEMEENTE_ID",

                                             "STRAAT",

                                             "BERICHT",

                                             "TELEFOON_NR",

                                             "FAX_NR",

                                             "SLEUTEL_BERICHT",

                                             "CAMPING_ID",

                                             "IN_GEBRUIK",

                                             "DOMICILIEADRES_IND",

                                             "VERZORGINGSADRES_IND",

                                             "CORRESPONDENTIEADRES_IND",

                                             "FACTURATIEADRES_IND",

                                             "PRAKTIJKADRES_IND",

                                             "TAV",

                                             "REFERENTIE_SOORT",

                                             "REFERENTIE_ID",

                                             "LAND_CD",

                                             "ADRES_BUITENLAND",

                                             "VOLG_NR",

                                             "VERWIJDERD_IND",

                                             "WEV_ID",

                                             "X",

                                             "Y",

                                             "FACTZORGEN_IND",

                                             "VERBLIJFPLAATS_ID",

                                             "VERBLIJFADRES_IND",

                                             "FIN_REKENING_IND",

                                             "PATIENT_NR",

                                             "VERVANGENDOOR_ADRES_ID",

                                             "REDEN_ONVOLLEDIG_ADRES",

                                             "E_MAIL",

                                             "CREATIE_USER",

                                             "CREATIE_DT")

                  VALUES (p_straat_id,

                          p_huis_nr,

                          p_bus,

                          p_gemeente_id,

                          p_straat,

                          p_bericht,

                          p_telefoon_nr,

                          p_fax_nr,

                          p_sleutel_bericht,

                          p_camping_id,

                          p_in_gebruik,

                          p_domicilieadres_ind,

                          p_verzorgingsadres_ind,

                          p_correspondentieadres_ind,

                          p_facturatieadres_ind,

                          p_praktijkadres_ind,

                          p_tav,

                          p_referentie_soort,

                          p_referentie_id,

                          p_land_cd,

                          p_adres_buitenland,

                          p_volg_nr,

                          p_verwijderd_ind,

                          p_wev_id,

                          p_x,

                          p_y,

                          p_factzorgen_ind,

                          p_verblijfplaats_id,

                          p_verblijfadres_ind,

                          p_fin_rekening_ind,

                          p_patient_nr,

                          p_vervangendoor_adres_id,

                          p_reden_onvolledig_adres,

                          p_e_mail,

                          fw.utils.wijziging_user,

                          fw.utils.wijziging_dt)

                  RETURN "ADRES_ID",

                         "STRAAT_ID",

                         "HUIS_NR",

                         "BUS",

                         "GEMEENTE_ID",

                         "STRAAT",

                         "BERICHT",

                         "TELEFOON_NR",

                         "FAX_NR",

                         "SLEUTEL_BERICHT",

                         "CAMPING_ID",

                         "IN_GEBRUIK",

                         "DOMICILIEADRES_IND",

                         "VERZORGINGSADRES_IND",

                         "CORRESPONDENTIEADRES_IND",

                         "FACTURATIEADRES_IND",

                         "PRAKTIJKADRES_IND",

                         "TAV",

                         "REFERENTIE_SOORT",

                         "REFERENTIE_ID",

                         "LAND_CD",

                         "ADRES_BUITENLAND",

                         "VOLG_NR",

                         "VERWIJDERD_IND",

                         "WEV_ID",

                         "X",

                         "Y",

                         "FACTZORGEN_IND",

                         "VERBLIJFPLAATS_ID",

                         "VERBLIJFADRES_IND",

                         "FIN_REKENING_IND",

                         "PATIENT_NR",

                         "VERVANGENDOOR_ADRES_ID",

                         "REDEN_ONVOLLEDIG_ADRES",

                         "E_MAIL",

                         "CREATIE_USER",

                         "CREATIE_DT",

                         "WIJZIGING_USER",

                         "WIJZIGING_DT"

                  INTO v_row."ADRES_ID",

                       v_row."STRAAT_ID",

                       v_row."HUIS_NR",

                       v_row."BUS",

                       v_row."GEMEENTE_ID",

                       v_row."STRAAT",

                       v_row."BERICHT",

                       v_row."TELEFOON_NR",

                       v_row."FAX_NR",

                       v_row."SLEUTEL_BERICHT",

                       v_row."CAMPING_ID",

                       v_row."IN_GEBRUIK",

                       v_row."DOMICILIEADRES_IND",

                       v_row."VERZORGINGSADRES_IND",

                       v_row."CORRESPONDENTIEADRES_IND",

                       v_row."FACTURATIEADRES_IND",

                       v_row."PRAKTIJKADRES_IND",

                       v_row."TAV",

                       v_row."REFERENTIE_SOORT",

                       v_row."REFERENTIE_ID",

                       v_row."LAND_CD",

                       v_row."ADRES_BUITENLAND",

                       v_row."VOLG_NR",

                       v_row."VERWIJDERD_IND",

                       v_row."WEV_ID",

                       v_row."X",

                       v_row."Y",

                       v_row."FACTZORGEN_IND",

                       v_row."VERBLIJFPLAATS_ID",

                       v_row."VERBLIJFADRES_IND",

                       v_row."FIN_REKENING_IND",

                       v_row."PATIENT_NR",

                       v_row."VERVANGENDOOR_ADRES_ID",

                       v_row."REDEN_ONVOLLEDIG_ADRES",

                       v_row."E_MAIL",

                       v_row."CREATIE_USER",

                       v_row."CREATIE_DT",

                       v_row."WIJZIGING_USER",

                       v_row."WIJZIGING_DT";

              END IF;

       

       

       

       

              RETURN v_row;

          END create_row;

       

       

          ----------------------------------------

          PROCEDURE create_row (

              p_adres_id                   IN dal_adressen."ADRES_ID"%TYPE DEFAULT NULL,

              p_straat_id                  IN dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                    IN dal_adressen."HUIS_NR"%TYPE,

              p_bus                        IN dal_adressen."BUS"%TYPE,

              p_gemeente_id                IN dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                     IN dal_adressen."STRAAT"%TYPE,

              p_bericht                    IN dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                IN dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                     IN dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht            IN dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                 IN dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                 IN dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind         IN dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind       IN dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind   IN dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind        IN dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind          IN dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                        IN dal_adressen."TAV"%TYPE,

              p_referentie_soort           IN dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id              IN dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                    IN dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland           IN dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                    IN dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind             IN dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                     IN dal_adressen."WEV_ID"%TYPE,

              p_x                          IN dal_adressen."X"%TYPE,

              p_y                          IN dal_adressen."Y"%TYPE,

              p_factzorgen_ind             IN dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id          IN dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind          IN dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind           IN dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                 IN dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id     IN dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres     IN dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                     IN dal_adressen."E_MAIL"%TYPE)

          IS

              v_row   dal_adressen%ROWTYPE;

              v_pk    afda_adressen."ADRES_ID"%TYPE := p_adres_id;

          BEGIN

              v_row :=

                  create_row (

                      p_adres_id                   => v_pk,

                      p_straat_id                  => p_straat_id,

                      p_huis_nr                    => p_huis_nr,

                      p_bus                        => p_bus,

                      p_gemeente_id                => p_gemeente_id,

                      p_straat                     => p_straat,

                      p_bericht                    => p_bericht,

                      p_telefoon_nr                => p_telefoon_nr,

                      p_fax_nr                     => p_fax_nr,

                      p_sleutel_bericht            => p_sleutel_bericht,

                      p_camping_id                 => p_camping_id,

                      p_in_gebruik                 => p_in_gebruik,

                      p_domicilieadres_ind         => p_domicilieadres_ind,

                      p_verzorgingsadres_ind       => p_verzorgingsadres_ind,

                      p_correspondentieadres_ind   => p_correspondentieadres_ind,

                      p_facturatieadres_ind        => p_facturatieadres_ind,

                      p_praktijkadres_ind          => p_praktijkadres_ind,

                      p_tav                        => p_tav,

                      p_referentie_soort           => p_referentie_soort,

                      p_referentie_id              => p_referentie_id,

                      p_land_cd                    => p_land_cd,

                      p_adres_buitenland           => p_adres_buitenland,

                      p_volg_nr                    => p_volg_nr,

                      p_verwijderd_ind             => p_verwijderd_ind,

                      p_wev_id                     => p_wev_id,

                      p_x                          => p_x,

                      p_y                          => p_y,

                      p_factzorgen_ind             => p_factzorgen_ind,

                      p_verblijfplaats_id          => p_verblijfplaats_id,

                      p_verblijfadres_ind          => p_verblijfadres_ind,

                      p_fin_rekening_ind           => p_fin_rekening_ind,

                      p_patient_nr                 => p_patient_nr,

                      p_vervangendoor_adres_id     => p_vervangendoor_adres_id,

                      p_reden_onvolledig_adres     => p_reden_onvolledig_adres,

                      p_e_mail                     => p_e_mail);

          END create_row;

       

       

          ----------------------------------------

          FUNCTION create_row (p_row IN dal_adressen%ROWTYPE)

              RETURN dal_adressen%ROWTYPE

          IS

          BEGIN

              RETURN create_row (p_adres_id =>

                                     p_row."ADRES_ID",

                                 p_straat_id =>

                                     p_row."STRAAT_ID",

                                 p_huis_nr =>

                                     p_row."HUIS_NR",

                                 p_bus =>

                                     p_row."BUS",

                                 p_gemeente_id =>

                                     p_row."GEMEENTE_ID",

                                 p_straat =>

                                     p_row."STRAAT",

                                 p_bericht =>

                                     p_row."BERICHT",

                                 p_telefoon_nr =>

                                     p_row."TELEFOON_NR",

                                 p_fax_nr =>

                                     p_row."FAX_NR",

                                 p_sleutel_bericht =>

                                     p_row."SLEUTEL_BERICHT",

                                 p_camping_id =>

                                     p_row."CAMPING_ID",

                                 p_in_gebruik =>

                                     p_row."IN_GEBRUIK",

                                 p_domicilieadres_ind =>

                                     p_row."DOMICILIEADRES_IND",

                                 p_verzorgingsadres_ind =>

                                     p_row."VERZORGINGSADRES_IND",

                                 p_correspondentieadres_ind =>

                                     p_row."CORRESPONDENTIEADRES_IND",

                                 p_facturatieadres_ind =>

                                     p_row."FACTURATIEADRES_IND",

                                 p_praktijkadres_ind =>

                                     p_row."PRAKTIJKADRES_IND",

                                 p_tav =>

                                     p_row."TAV",

                                 p_referentie_soort =>

                                     p_row."REFERENTIE_SOORT",

                                 p_referentie_id =>

                                     p_row."REFERENTIE_ID",

                                 p_land_cd =>

                                     p_row."LAND_CD",

                                 p_adres_buitenland =>

                                     p_row."ADRES_BUITENLAND",

                                 p_volg_nr =>

                                     p_row."VOLG_NR",

                                 p_verwijderd_ind =>

                                     p_row."VERWIJDERD_IND",

                                 p_wev_id =>

                                     p_row."WEV_ID",

                                 p_x =>

                                     p_row."X",

                                 p_y =>

                                     p_row."Y",

                                 p_factzorgen_ind =>

                                     p_row."FACTZORGEN_IND",

                                 p_verblijfplaats_id =>

                                     p_row."VERBLIJFPLAATS_ID",

                                 p_verblijfadres_ind =>

                                     p_row."VERBLIJFADRES_IND",

                                 p_fin_rekening_ind =>

                                     p_row."FIN_REKENING_IND",

                                 p_patient_nr =>

                                     p_row."PATIENT_NR",

                                 p_vervangendoor_adres_id =>

                                     p_row."VERVANGENDOOR_ADRES_ID",

                                 p_reden_onvolledig_adres =>

                                     p_row."REDEN_ONVOLLEDIG_ADRES",

                                 p_e_mail =>

                                     p_row."E_MAIL");

          END create_row;

       

       

          ----------------------------------------

          PROCEDURE create_row (p_row IN OUT dal_adressen%ROWTYPE)

          IS

          BEGIN

              p_row := create_row (p_row => p_row);

          END create_row;

       

       

          ----------------------------------------

          FUNCTION read_row (p_adres_id IN dal_adressen."ADRES_ID"%TYPE)

              RETURN dal_adressen%ROWTYPE

          IS

              CURSOR cur_row_by_pk (p_adres_id IN afda_adressen."ADRES_ID"%TYPE)

              IS

                  SELECT "ADRES_ID",

                         "STRAAT_ID",

                         "HUIS_NR",

                         "BUS",

                         "GEMEENTE_ID",

                         "STRAAT",

                         "BERICHT",

                         "TELEFOON_NR",

                         "FAX_NR",

                         "SLEUTEL_BERICHT",

                         "CAMPING_ID",

                         "IN_GEBRUIK",

                         "DOMICILIEADRES_IND",

                         "VERZORGINGSADRES_IND",

                         "CORRESPONDENTIEADRES_IND",

                         "FACTURATIEADRES_IND",

                         "PRAKTIJKADRES_IND",

                         "TAV",

                         "REFERENTIE_SOORT",

                         "REFERENTIE_ID",

                         "LAND_CD",

                         "ADRES_BUITENLAND",

                         "VOLG_NR",

                         "VERWIJDERD_IND",

                         "WEV_ID",

                         "X",

                         "Y",

                         "FACTZORGEN_IND",

                         "VERBLIJFPLAATS_ID",

                         "VERBLIJFADRES_IND",

                         "FIN_REKENING_IND",

                         "PATIENT_NR",

                         "VERVANGENDOOR_ADRES_ID",

                         "REDEN_ONVOLLEDIG_ADRES",

                         "E_MAIL",

                         "CREATIE_USER",

                         "CREATIE_DT",

                         "WIJZIGING_USER",

                         "WIJZIGING_DT"

                  FROM dal_adressen

                  WHERE "ADRES_ID" = p_adres_id;

       

       

              v_row   dal_adressen%ROWTYPE;

          BEGIN

              OPEN cur_row_by_pk (p_adres_id);

       

       

              FETCH cur_row_by_pk

                    INTO v_row."ADRES_ID",

                         v_row."STRAAT_ID",

                         v_row."HUIS_NR",

                         v_row."BUS",

                         v_row."GEMEENTE_ID",

                         v_row."STRAAT",

                         v_row."BERICHT",

                         v_row."TELEFOON_NR",

                         v_row."FAX_NR",

                         v_row."SLEUTEL_BERICHT",

                         v_row."CAMPING_ID",

                         v_row."IN_GEBRUIK",

                         v_row."DOMICILIEADRES_IND",

                         v_row."VERZORGINGSADRES_IND",

                         v_row."CORRESPONDENTIEADRES_IND",

                         v_row."FACTURATIEADRES_IND",

                         v_row."PRAKTIJKADRES_IND",

                         v_row."TAV",

                         v_row."REFERENTIE_SOORT",

                         v_row."REFERENTIE_ID",

                         v_row."LAND_CD",

                         v_row."ADRES_BUITENLAND",

                         v_row."VOLG_NR",

                         v_row."VERWIJDERD_IND",

                         v_row."WEV_ID",

                         v_row."X",

                         v_row."Y",

                         v_row."FACTZORGEN_IND",

                         v_row."VERBLIJFPLAATS_ID",

                         v_row."VERBLIJFADRES_IND",

                         v_row."FIN_REKENING_IND",

                         v_row."PATIENT_NR",

                         v_row."VERVANGENDOOR_ADRES_ID",

                         v_row."REDEN_ONVOLLEDIG_ADRES",

                         v_row."E_MAIL",

                         v_row."CREATIE_USER",

                         v_row."CREATIE_DT",

                         v_row."WIJZIGING_USER",

                         v_row."WIJZIGING_DT";

       

       

              CLOSE cur_row_by_pk;

       

       

              RETURN v_row;

          END read_row;

       

       

          ----------------------------------------

          PROCEDURE read_row (

              p_adres_id                   IN            dal_adressen."ADRES_ID"%TYPE,

              p_straat_id                     OUT NOCOPY dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                       OUT NOCOPY dal_adressen."HUIS_NR"%TYPE,

              p_bus                           OUT NOCOPY dal_adressen."BUS"%TYPE,

              p_gemeente_id                   OUT NOCOPY dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                        OUT NOCOPY dal_adressen."STRAAT"%TYPE,

              p_bericht                       OUT NOCOPY dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                   OUT NOCOPY dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                        OUT NOCOPY dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht               OUT NOCOPY dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                    OUT NOCOPY dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                    OUT NOCOPY dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind            OUT NOCOPY dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind          OUT NOCOPY dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind      OUT NOCOPY dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind           OUT NOCOPY dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind             OUT NOCOPY dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                           OUT NOCOPY dal_adressen."TAV"%TYPE,

              p_referentie_soort              OUT NOCOPY dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id                 OUT NOCOPY dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                       OUT NOCOPY dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland              OUT NOCOPY dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                       OUT NOCOPY dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind                OUT NOCOPY dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                        OUT NOCOPY dal_adressen."WEV_ID"%TYPE,

              p_x                             OUT NOCOPY dal_adressen."X"%TYPE,

              p_y                             OUT NOCOPY dal_adressen."Y"%TYPE,

              p_factzorgen_ind                OUT NOCOPY dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id             OUT NOCOPY dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind             OUT NOCOPY dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind              OUT NOCOPY dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                    OUT NOCOPY dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id        OUT NOCOPY dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres        OUT NOCOPY dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                        OUT NOCOPY dal_adressen."E_MAIL"%TYPE)

          IS

              v_row   dal_adressen%ROWTYPE;

          BEGIN

              v_row := read_row (p_adres_id => p_adres_id);

       

       

              IF v_row."ADRES_ID" IS NOT NULL

              THEN

                  p_straat_id := v_row."STRAAT_ID";

                  p_huis_nr := v_row."HUIS_NR";

                  p_bus := v_row."BUS";

                  p_gemeente_id := v_row."GEMEENTE_ID";

                  p_straat := v_row."STRAAT";

                  p_bericht := v_row."BERICHT";

                  p_telefoon_nr := v_row."TELEFOON_NR";

                  p_fax_nr := v_row."FAX_NR";

                  p_sleutel_bericht := v_row."SLEUTEL_BERICHT";

                  p_camping_id := v_row."CAMPING_ID";

                  p_in_gebruik := v_row."IN_GEBRUIK";

                  p_domicilieadres_ind := v_row."DOMICILIEADRES_IND";

                  p_verzorgingsadres_ind := v_row."VERZORGINGSADRES_IND";

                  p_correspondentieadres_ind := v_row."CORRESPONDENTIEADRES_IND";

                  p_facturatieadres_ind := v_row."FACTURATIEADRES_IND";

                  p_praktijkadres_ind := v_row."PRAKTIJKADRES_IND";

                  p_tav := v_row."TAV";

                  p_referentie_soort := v_row."REFERENTIE_SOORT";

                  p_referentie_id := v_row."REFERENTIE_ID";

                  p_land_cd := v_row."LAND_CD";

                  p_adres_buitenland := v_row."ADRES_BUITENLAND";

                  p_volg_nr := v_row."VOLG_NR";

                  p_verwijderd_ind := v_row."VERWIJDERD_IND";

                  p_wev_id := v_row."WEV_ID";

                  p_x := v_row."X";

                  p_y := v_row."Y";

                  p_factzorgen_ind := v_row."FACTZORGEN_IND";

                  p_verblijfplaats_id := v_row."VERBLIJFPLAATS_ID";

                  p_verblijfadres_ind := v_row."VERBLIJFADRES_IND";

                  p_fin_rekening_ind := v_row."FIN_REKENING_IND";

                  p_patient_nr := v_row."PATIENT_NR";

                  p_vervangendoor_adres_id := v_row."VERVANGENDOOR_ADRES_ID";

                  p_reden_onvolledig_adres := v_row."REDEN_ONVOLLEDIG_ADRES";

                  p_e_mail := v_row."E_MAIL";

              END IF;

          END read_row;

       

       

          ----------------------------------------

          FUNCTION read_hist_row (p_adres_id IN dal_adressen."ADRES_ID"%TYPE)

              RETURN dal_adressen%ROWTYPE

          IS

              v_row   dal_adressen%ROWTYPE;

       

       

              CURSOR c_historiek (pc_key IN afda_adressen."ADRES_ID"%TYPE)

              IS

                  SELECT "ADRES_ID",

                         "STRAAT_ID",

                         "HUIS_NR",

                         "BUS",

                         "GEMEENTE_ID",

                         "STRAAT",

                         "BERICHT",

                         "TELEFOON_NR",

                         "FAX_NR",

                         "SLEUTEL_BERICHT",

                         "CAMPING_ID",

                         "IN_GEBRUIK",

                         "DOMICILIEADRES_IND",

                         "VERZORGINGSADRES_IND",

                         "CORRESPONDENTIEADRES_IND",

                         "FACTURATIEADRES_IND",

                         "PRAKTIJKADRES_IND",

                         "TAV",

                         "REFERENTIE_SOORT",

                         "REFERENTIE_ID",

                         "LAND_CD",

                         "ADRES_BUITENLAND",

                         "VOLG_NR",

                         "VERWIJDERD_IND",

                         "WEV_ID",

                         "X",

                         "Y",

                         "FACTZORGEN_IND",

                         "VERBLIJFPLAATS_ID",

                         "VERBLIJFADRES_IND",

                         "FIN_REKENING_IND",

                         "PATIENT_NR",

                         "VERVANGENDOOR_ADRES_ID",

                         "REDEN_ONVOLLEDIG_ADRES",

                         "E_MAIL",

                         "CREATIE_USER",

                         "CREATIE_DT",

                         "WIJZIGING_USER",

                         "WIJZIGING_DT"

                  FROM afda.sys_fba_hist_77548

                  WHERE adres_id = pc_key AND operation = 'D'

                  ORDER BY endscn DESC

                  FETCH FIRST 1 ROWS ONLY;

          BEGIN

              OPEN c_historiek (p_adres_id);

       

       

              FETCH c_historiek

                    INTO v_row."ADRES_ID",

                         v_row."STRAAT_ID",

                         v_row."HUIS_NR",

                         v_row."BUS",

                         v_row."GEMEENTE_ID",

                         v_row."STRAAT",

                         v_row."BERICHT",

                         v_row."TELEFOON_NR",

                         v_row."FAX_NR",

                         v_row."SLEUTEL_BERICHT",

                         v_row."CAMPING_ID",

                         v_row."IN_GEBRUIK",

                         v_row."DOMICILIEADRES_IND",

                         v_row."VERZORGINGSADRES_IND",

                         v_row."CORRESPONDENTIEADRES_IND",

                         v_row."FACTURATIEADRES_IND",

                         v_row."PRAKTIJKADRES_IND",

                         v_row."TAV",

                         v_row."REFERENTIE_SOORT",

                         v_row."REFERENTIE_ID",

                         v_row."LAND_CD",

                         v_row."ADRES_BUITENLAND",

                         v_row."VOLG_NR",

                         v_row."VERWIJDERD_IND",

                         v_row."WEV_ID",

                         v_row."X",

                         v_row."Y",

                         v_row."FACTZORGEN_IND",

                         v_row."VERBLIJFPLAATS_ID",

                         v_row."VERBLIJFADRES_IND",

                         v_row."FIN_REKENING_IND",

                         v_row."PATIENT_NR",

                         v_row."VERVANGENDOOR_ADRES_ID",

                         v_row."REDEN_ONVOLLEDIG_ADRES",

                         v_row."E_MAIL",

                         v_row."CREATIE_USER",

                         v_row."CREATIE_DT",

                         v_row."WIJZIGING_USER",

                         v_row."WIJZIGING_DT";

       

       

              CLOSE c_historiek;

       

       

              RETURN v_row;

          END read_hist_row;

       

       

          ----------------------------------------

          FUNCTION init_row (p_adres_id               IN     dal_adressen."ADRES_ID"%TYPE --, p_row OUT DAL_ADRESSEN%ROWTYPE

                                                                                         ,

                             p_gekende_key               OUT BOOLEAN,

                             p_zoek_in_total_recall   IN     BOOLEAN)

              RETURN dal_adressen%ROWTYPE

          IS

              v_row   dal_adressen%ROWTYPE;

          BEGIN

              -- zoek het record in de tabel of de flashback tabel

              IF p_adres_id IS NOT NULL

              THEN

                  v_row := read_row (p_adres_id => p_adres_id);

       

       

                  IF v_row."ADRES_ID" IS NULL AND p_zoek_in_total_recall

                  THEN

                      v_row := read_hist_row (p_adres_id => p_adres_id);

                  END IF;

              END IF;

       

       

              p_gekende_key := v_row."ADRES_ID" IS NOT NULL;

       

       

              IF NOT p_gekende_key                      -- instellen column defaults

              THEN

                  NULL;

                  v_row."ADRES_ID" := p_adres_id;

                  v_row.land_cd := NULL;

                  v_row.verwijderd_ind := 'N';

                  v_row.factzorgen_ind := 'N';

                  v_row.verblijfadres_ind := 'N';

                  v_row.fin_rekening_ind := 'N';

              END IF;

       

       

              RETURN v_row;

          END init_row;

       

       

          ----------------------------------------

          PROCEDURE update_row (

              p_adres_id                   IN dal_adressen."ADRES_ID"%TYPE DEFAULT NULL,

              p_straat_id                  IN dal_adressen."STRAAT_ID"%TYPE,

              p_huis_nr                    IN dal_adressen."HUIS_NR"%TYPE,

              p_bus                        IN dal_adressen."BUS"%TYPE,

              p_gemeente_id                IN dal_adressen."GEMEENTE_ID"%TYPE,

              p_straat                     IN dal_adressen."STRAAT"%TYPE,

              p_bericht                    IN dal_adressen."BERICHT"%TYPE,

              p_telefoon_nr                IN dal_adressen."TELEFOON_NR"%TYPE,

              p_fax_nr                     IN dal_adressen."FAX_NR"%TYPE,

              p_sleutel_bericht            IN dal_adressen."SLEUTEL_BERICHT"%TYPE,

              p_camping_id                 IN dal_adressen."CAMPING_ID"%TYPE,

              p_in_gebruik                 IN dal_adressen."IN_GEBRUIK"%TYPE,

              p_domicilieadres_ind         IN dal_adressen."DOMICILIEADRES_IND"%TYPE,

              p_verzorgingsadres_ind       IN dal_adressen."VERZORGINGSADRES_IND"%TYPE,

              p_correspondentieadres_ind   IN dal_adressen."CORRESPONDENTIEADRES_IND"%TYPE,

              p_facturatieadres_ind        IN dal_adressen."FACTURATIEADRES_IND"%TYPE,

              p_praktijkadres_ind          IN dal_adressen."PRAKTIJKADRES_IND"%TYPE,

              p_tav                        IN dal_adressen."TAV"%TYPE,

              p_referentie_soort           IN dal_adressen."REFERENTIE_SOORT"%TYPE,

              p_referentie_id              IN dal_adressen."REFERENTIE_ID"%TYPE,

              p_land_cd                    IN dal_adressen."LAND_CD"%TYPE,

              p_adres_buitenland           IN dal_adressen."ADRES_BUITENLAND"%TYPE,

              p_volg_nr                    IN dal_adressen."VOLG_NR"%TYPE,

              p_verwijderd_ind             IN dal_adressen."VERWIJDERD_IND"%TYPE,

              p_wev_id                     IN dal_adressen."WEV_ID"%TYPE,

              p_x                          IN dal_adressen."X"%TYPE,

              p_y                          IN dal_adressen."Y"%TYPE,

              p_factzorgen_ind             IN dal_adressen."FACTZORGEN_IND"%TYPE,

              p_verblijfplaats_id          IN dal_adressen."VERBLIJFPLAATS_ID"%TYPE,

              p_verblijfadres_ind          IN dal_adressen."VERBLIJFADRES_IND"%TYPE,

              p_fin_rekening_ind           IN dal_adressen."FIN_REKENING_IND"%TYPE,

              p_patient_nr                 IN dal_adressen."PATIENT_NR"%TYPE,

              p_vervangendoor_adres_id     IN dal_adressen."VERVANGENDOOR_ADRES_ID"%TYPE,

              p_reden_onvolledig_adres     IN dal_adressen."REDEN_ONVOLLEDIG_ADRES"%TYPE,

              p_e_mail                     IN dal_adressen."E_MAIL"%TYPE)

          IS

              v_row   dal_adressen%ROWTYPE;

          BEGIN

              v_row."ADRES_ID" := p_adres_id;

              v_row."STRAAT_ID" := p_straat_id;

              v_row."HUIS_NR" := p_huis_nr;

              v_row."BUS" := p_bus;

              v_row."GEMEENTE_ID" := p_gemeente_id;

              v_row."STRAAT" := p_straat;

              v_row."BERICHT" := p_bericht;

              v_row."TELEFOON_NR" := p_telefoon_nr;

              v_row."FAX_NR" := p_fax_nr;

              v_row."SLEUTEL_BERICHT" := p_sleutel_bericht;

              v_row."CAMPING_ID" := p_camping_id;

              v_row."IN_GEBRUIK" := p_in_gebruik;

              v_row."DOMICILIEADRES_IND" := p_domicilieadres_ind;

              v_row."VERZORGINGSADRES_IND" := p_verzorgingsadres_ind;

              v_row."CORRESPONDENTIEADRES_IND" := p_correspondentieadres_ind;

              v_row."FACTURATIEADRES_IND" := p_facturatieadres_ind;

              v_row."PRAKTIJKADRES_IND" := p_praktijkadres_ind;

              v_row."TAV" := p_tav;

              v_row."REFERENTIE_SOORT" := p_referentie_soort;

              v_row."REFERENTIE_ID" := p_referentie_id;

              v_row."LAND_CD" := p_land_cd;

              v_row."ADRES_BUITENLAND" := p_adres_buitenland;

              v_row."VOLG_NR" := p_volg_nr;

              v_row."VERWIJDERD_IND" := p_verwijderd_ind;

              v_row."WEV_ID" := p_wev_id;

              v_row."X" := p_x;

              v_row."Y" := p_y;

              v_row."FACTZORGEN_IND" := p_factzorgen_ind;

              v_row."VERBLIJFPLAATS_ID" := p_verblijfplaats_id;

              v_row."VERBLIJFADRES_IND" := p_verblijfadres_ind;

              v_row."FIN_REKENING_IND" := p_fin_rekening_ind;

              v_row."PATIENT_NR" := p_patient_nr;

              v_row."VERVANGENDOOR_ADRES_ID" := p_vervangendoor_adres_id;

              v_row."REDEN_ONVOLLEDIG_ADRES" := p_reden_onvolledig_adres;

              v_row."E_MAIL" := p_e_mail;

       

       

              v_row := update_row (p_row => v_row);

          END update_row;

       

       

          ----------------------------------------

          FUNCTION update_row (p_row IN dal_adressen%ROWTYPE)

              RETURN dal_adressen%ROWTYPE

          IS

              v_row   dal_adressen%ROWTYPE;

          BEGIN

              v_row := read_row (p_adres_id => p_row.adres_id);

       

       

              IF v_row."ADRES_ID" IS NOT NULL

              THEN

                  -- update only, if the column values really differ

                  IF    NOT fw.utils.equals (p_1   => v_row."STRAAT_ID",

                                             p_2   => p_row."STRAAT_ID")

                     OR NOT fw.utils.equals (p_1   => v_row."HUIS_NR",

                                             p_2   => p_row."HUIS_NR")

                     OR NOT fw.utils.equals (p_1 => v_row."BUS", p_2 => p_row."BUS")

                     OR NOT fw.utils.equals (p_1   => v_row."GEMEENTE_ID",

                                             p_2   => p_row."GEMEENTE_ID")

                     OR NOT fw.utils.equals (p_1   => v_row."STRAAT",

                                             p_2   => p_row."STRAAT")

                     OR NOT fw.utils.equals (p_1   => v_row."BERICHT",

                                             p_2   => p_row."BERICHT")

                     OR NOT fw.utils.equals (p_1   => v_row."TELEFOON_NR",

                                             p_2   => p_row."TELEFOON_NR")

                     OR NOT fw.utils.equals (p_1   => v_row."FAX_NR",

                                             p_2   => p_row."FAX_NR")

                     OR NOT fw.utils.equals (p_1   => v_row."SLEUTEL_BERICHT",

                                             p_2   => p_row."SLEUTEL_BERICHT")

                     OR NOT fw.utils.equals (p_1   => v_row."CAMPING_ID",

                                             p_2   => p_row."CAMPING_ID")

                     OR NOT fw.utils.equals (p_1   => v_row."IN_GEBRUIK",

                                             p_2   => p_row."IN_GEBRUIK")

                     OR NOT fw.utils.equals (p_1   => v_row."DOMICILIEADRES_IND",

                                             p_2   => p_row."DOMICILIEADRES_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."VERZORGINGSADRES_IND",

                                             p_2   => p_row."VERZORGINGSADRES_IND")

                     OR NOT fw.utils.equals (

                                p_1   => v_row."CORRESPONDENTIEADRES_IND",

                                p_2   => p_row."CORRESPONDENTIEADRES_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."FACTURATIEADRES_IND",

                                             p_2   => p_row."FACTURATIEADRES_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."PRAKTIJKADRES_IND",

                                             p_2   => p_row."PRAKTIJKADRES_IND")

                     OR NOT fw.utils.equals (p_1 => v_row."TAV", p_2 => p_row."TAV")

                     OR NOT fw.utils.equals (p_1   => v_row."REFERENTIE_SOORT",

                                             p_2   => p_row."REFERENTIE_SOORT")

                     OR NOT fw.utils.equals (p_1   => v_row."REFERENTIE_ID",

                                             p_2   => p_row."REFERENTIE_ID")

                     OR NOT fw.utils.equals (p_1   => v_row."LAND_CD",

                                             p_2   => p_row."LAND_CD")

                     OR NOT fw.utils.equals (p_1   => v_row."ADRES_BUITENLAND",

                                             p_2   => p_row."ADRES_BUITENLAND")

                     OR NOT fw.utils.equals (p_1   => v_row."VOLG_NR",

                                             p_2   => p_row."VOLG_NR")

                     OR NOT fw.utils.equals (p_1   => v_row."VERWIJDERD_IND",

                                             p_2   => p_row."VERWIJDERD_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."WEV_ID",

                                             p_2   => p_row."WEV_ID")

                     OR NOT fw.utils.equals (p_1 => v_row."X", p_2 => p_row."X")

                     OR NOT fw.utils.equals (p_1 => v_row."Y", p_2 => p_row."Y")

                     OR NOT fw.utils.equals (p_1   => v_row."FACTZORGEN_IND",

                                             p_2   => p_row."FACTZORGEN_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."VERBLIJFPLAATS_ID",

                                             p_2   => p_row."VERBLIJFPLAATS_ID")

                     OR NOT fw.utils.equals (p_1   => v_row."VERBLIJFADRES_IND",

                                             p_2   => p_row."VERBLIJFADRES_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."FIN_REKENING_IND",

                                             p_2   => p_row."FIN_REKENING_IND")

                     OR NOT fw.utils.equals (p_1   => v_row."PATIENT_NR",

                                             p_2   => p_row."PATIENT_NR")

                     OR NOT fw.utils.equals (

                                p_1   => v_row."VERVANGENDOOR_ADRES_ID",

                                p_2   => p_row."VERVANGENDOOR_ADRES_ID")

                     OR NOT fw.utils.equals (

                                p_1   => v_row."REDEN_ONVOLLEDIG_ADRES",

                                p_2   => p_row."REDEN_ONVOLLEDIG_ADRES")

                     OR NOT fw.utils.equals (p_1   => v_row."E_MAIL",

                                             p_2   => p_row."E_MAIL")

                  THEN

                      check_not_null_cols (p_row => p_row);

                      check_foreign_keys (p_row => p_row);

       

       

                      UPDATE afda_adressen

                      SET "STRAAT_ID" = p_row."STRAAT_ID",

                          "HUIS_NR" = p_row."HUIS_NR",

                          "BUS" = p_row."BUS",

                          "GEMEENTE_ID" = p_row."GEMEENTE_ID",

                          "STRAAT" = p_row."STRAAT",

                          "BERICHT" = p_row."BERICHT",

                          "TELEFOON_NR" = p_row."TELEFOON_NR",

                          "FAX_NR" = p_row."FAX_NR",

                          "SLEUTEL_BERICHT" = p_row."SLEUTEL_BERICHT",

                          "CAMPING_ID" = p_row."CAMPING_ID",

                          "IN_GEBRUIK" = p_row."IN_GEBRUIK",

                          "DOMICILIEADRES_IND" = p_row."DOMICILIEADRES_IND",

                          "VERZORGINGSADRES_IND" = p_row."VERZORGINGSADRES_IND",

                          "CORRESPONDENTIEADRES_IND" =

                              p_row."CORRESPONDENTIEADRES_IND",

                          "FACTURATIEADRES_IND" = p_row."FACTURATIEADRES_IND",

                          "PRAKTIJKADRES_IND" = p_row."PRAKTIJKADRES_IND",

                          "TAV" = p_row."TAV",

                          "REFERENTIE_SOORT" = p_row."REFERENTIE_SOORT",

                          "REFERENTIE_ID" = p_row."REFERENTIE_ID",

                          "LAND_CD" = p_row."LAND_CD",

                          "ADRES_BUITENLAND" = p_row."ADRES_BUITENLAND",

                          "VOLG_NR" = p_row."VOLG_NR",

                          "VERWIJDERD_IND" = p_row."VERWIJDERD_IND",

                          "WEV_ID" = p_row."WEV_ID",

                          "X" = p_row."X",

                          "Y" = p_row."Y",

                          "FACTZORGEN_IND" = p_row."FACTZORGEN_IND",

                          "VERBLIJFPLAATS_ID" = p_row."VERBLIJFPLAATS_ID",

                          "VERBLIJFADRES_IND" = p_row."VERBLIJFADRES_IND",

                          "FIN_REKENING_IND" = p_row."FIN_REKENING_IND",

                          "PATIENT_NR" = p_row."PATIENT_NR",

                          "VERVANGENDOOR_ADRES_ID" = p_row."VERVANGENDOOR_ADRES_ID",

                          "REDEN_ONVOLLEDIG_ADRES" = p_row."REDEN_ONVOLLEDIG_ADRES",

                          "E_MAIL" = p_row."E_MAIL",

                          "WIJZIGING_USER" = fw.utils.wijziging_user,

                          "WIJZIGING_DT" = fw.utils.wijziging_dt

                      WHERE "ADRES_ID" = v_row."ADRES_ID"

                      RETURN "ADRES_ID",

                             "STRAAT_ID",

                             "HUIS_NR",

                             "BUS",

                             "GEMEENTE_ID",

                             "STRAAT",

                             "BERICHT",

                             "TELEFOON_NR",

                             "FAX_NR",

                             "SLEUTEL_BERICHT",

                             "CAMPING_ID",

                             "IN_GEBRUIK",

                             "DOMICILIEADRES_IND",

                             "VERZORGINGSADRES_IND",

                             "CORRESPONDENTIEADRES_IND",

                             "FACTURATIEADRES_IND",

                             "PRAKTIJKADRES_IND",

                             "TAV",

                             "REFERENTIE_SOORT",

                             "REFERENTIE_ID",

                             "LAND_CD",

                             "ADRES_BUITENLAND",

                             "VOLG_NR",

                             "VERWIJDERD_IND",

                             "WEV_ID",

                             "X",

                             "Y",

                             "FACTZORGEN_IND",

                             "VERBLIJFPLAATS_ID",

                             "VERBLIJFADRES_IND",

                             "FIN_REKENING_IND",

                             "PATIENT_NR",

                             "VERVANGENDOOR_ADRES_ID",

                             "REDEN_ONVOLLEDIG_ADRES",

                             "E_MAIL",

                             "CREATIE_USER",

                             "CREATIE_DT",

                             "WIJZIGING_USER",

                             "WIJZIGING_DT"

                      INTO v_row."ADRES_ID",

                           v_row."STRAAT_ID",

                           v_row."HUIS_NR",

                           v_row."BUS",

                           v_row."GEMEENTE_ID",

                           v_row."STRAAT",

                           v_row."BERICHT",

                           v_row."TELEFOON_NR",

                           v_row."FAX_NR",

                           v_row."SLEUTEL_BERICHT",

                           v_row."CAMPING_ID",

                           v_row."IN_GEBRUIK",

                           v_row."DOMICILIEADRES_IND",

                           v_row."VERZORGINGSADRES_IND",

                           v_row."CORRESPONDENTIEADRES_IND",

                           v_row."FACTURATIEADRES_IND",

                           v_row."PRAKTIJKADRES_IND",

                           v_row."TAV",

                           v_row."REFERENTIE_SOORT",

                           v_row."REFERENTIE_ID",

                           v_row."LAND_CD",

                           v_row."ADRES_BUITENLAND",

                           v_row."VOLG_NR",

                           v_row."VERWIJDERD_IND",

                           v_row."WEV_ID",

                           v_row."X",

                           v_row."Y",

                           v_row."FACTZORGEN_IND",

                           v_row."VERBLIJFPLAATS_ID",

                           v_row."VERBLIJFADRES_IND",

                           v_row."FIN_REKENING_IND",

                           v_row."PATIENT_NR",

                           v_row."VERVANGENDOOR_ADRES_ID",

                           v_row."REDEN_ONVOLLEDIG_ADRES",

                           v_row."E_MAIL",

                           v_row."CREATIE_USER",

                           v_row."CREATIE_DT",

                           v_row."WIJZIGING_USER",

                           v_row."WIJZIGING_DT";

                  END IF;

              END IF;

       

       

              RETURN v_row;

          END update_row;

       

       

          ----------------------------------------

          PROCEDURE delete_row (p_adres_id IN dal_adressen."ADRES_ID"%TYPE)

          IS

          BEGIN

              DELETE FROM afda_adressen

              WHERE "ADRES_ID" = p_adres_id;

          END delete_row;

       

       

          ----------------------------------------

          FUNCTION create_or_update_row (p_row IN dal_adressen%ROWTYPE)

              RETURN dal_adressen%ROWTYPE

          IS

          BEGIN

              IF row_exists (p_adres_id => p_row.adres_id)

              THEN

                  RETURN update_row (p_row => p_row);

              ELSE

                  RETURN create_row (p_row => p_row);

              END IF;

          END create_or_update_row;

       

       

          ----------------------------------------

          PROCEDURE create_or_update_row (p_row IN OUT dal_adressen%ROWTYPE)

          IS

          BEGIN

              p_row := create_or_update_row (p_row => p_row);

          END create_or_update_row;

      ----------------------------------------

      END api_adressen;