The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_update boolean;
l_update_override boolean;
l_update_change_insert boolean;
l_delete boolean;
l_delete_next_change boolean;
if p_mini_mode = 'U' then -- update
ben_ppr_shd.find_dt_upd_modes
(p_effective_date => p_effective_date
,p_base_key_value => p_base_key_value
,p_correction => l_correction
,p_update => l_update
,p_update_override => l_update_override
,p_update_change_insert => l_update_change_insert
);
if (p_desired_datetrack_mode = hr_api.g_update and l_update) then
p_datetrack_allow := hr_api.g_update;
elsif(p_desired_datetrack_mode = hr_api.g_update_override
and l_update_override) then
p_datetrack_allow := hr_api.g_update_override;
elsif(p_desired_datetrack_mode = hr_api.g_update_change_insert
and l_update_change_insert) then
p_datetrack_allow := hr_api.g_update_change_insert;
elsif(l_update) then
p_datetrack_allow := hr_api.g_update;
else -- mini-mode = 'D' for delete
ben_ppr_shd.find_dt_del_modes
(p_effective_date => p_effective_date
,p_base_key_value => p_base_key_value
,p_zap => l_zap
,p_delete => l_delete
,p_future_change => l_future_change
,p_delete_next_change => l_delete_next_change);
if (p_desired_datetrack_mode = hr_api.g_delete and l_delete) then
p_datetrack_allow := hr_api.g_delete;
elsif(p_desired_datetrack_mode = hr_api.g_delete_next_change
and l_delete_next_change) then
p_datetrack_allow := hr_api.g_delete_next_change;
elsif (l_delete) then
p_datetrack_allow := hr_api.g_delete;
,p_program_update_date in date default null
,p_object_version_number out nocopy number
,p_effective_date in date
) is
--
-- Declare cursors and local variables
--
l_prmry_care_prvdr_id ben_prmry_care_prvdr_f.prmry_care_prvdr_id%TYPE;
,p_program_update_date => p_program_update_date
,p_effective_date => trunc(p_effective_date)
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(p_effective_date)
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(p_effective_date)
);
procedure update_PRMRY_CARE_PRVDR
(p_validate in boolean default false
,p_prmry_care_prvdr_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_prmry_care_prvdr_typ_cd in varchar2 default hr_api.g_varchar2
,p_name in varchar2 default hr_api.g_varchar2
,p_ext_ident in varchar2 default hr_api.g_varchar2
,p_prtt_enrt_rslt_id in number default hr_api.g_number
,p_elig_cvrd_dpnt_id in number default hr_api.g_number
,p_business_group_id in number default hr_api.g_number
,p_ppr_attribute_category in varchar2 default hr_api.g_varchar2
,p_ppr_attribute1 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute2 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute3 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute4 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute5 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute6 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute7 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute8 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute9 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute10 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute11 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute12 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute13 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute14 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute15 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute16 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute17 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute18 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute19 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute20 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute21 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute22 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute23 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute24 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute25 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute26 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute27 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute28 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute29 in varchar2 default hr_api.g_varchar2
,p_ppr_attribute30 in varchar2 default hr_api.g_varchar2
,p_request_id in number default hr_api.g_number
,p_program_application_id in number default hr_api.g_number
,p_program_id in number default hr_api.g_number
,p_program_update_date in date default hr_api.g_date
,p_object_version_number in out nocopy number
,p_effective_date in date
,p_datetrack_mode in varchar2
) is
--
-- Declare cursors and local variables
--
l_proc varchar2(72) := g_package||'update_PRMRY_CARE_PRVDR';
select pcp.prmry_care_prvdr_typ_cd,
pcp.name,
pcp.ext_ident,
pcp.prtt_enrt_rslt_id,
pcp.elig_cvrd_dpnt_id
from ben_prmry_care_prvdr_f pcp
where pcp.prmry_care_prvdr_id = p_prmry_care_prvdr_id
and p_effective_date between pcp.effective_start_date and pcp.effective_end_date;
savepoint update_PRMRY_CARE_PRVDR;
ben_PRMRY_CARE_PRVDR_bk2.update_PRMRY_CARE_PRVDR_b
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_prmry_care_prvdr_typ_cd => p_prmry_care_prvdr_typ_cd
,p_name => p_name
,p_ext_ident => p_ext_ident
,p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id
,p_elig_cvrd_dpnt_id => p_elig_cvrd_dpnt_id
,p_business_group_id => p_business_group_id
,p_ppr_attribute_category => p_ppr_attribute_category
,p_ppr_attribute1 => p_ppr_attribute1
,p_ppr_attribute2 => p_ppr_attribute2
,p_ppr_attribute3 => p_ppr_attribute3
,p_ppr_attribute4 => p_ppr_attribute4
,p_ppr_attribute5 => p_ppr_attribute5
,p_ppr_attribute6 => p_ppr_attribute6
,p_ppr_attribute7 => p_ppr_attribute7
,p_ppr_attribute8 => p_ppr_attribute8
,p_ppr_attribute9 => p_ppr_attribute9
,p_ppr_attribute10 => p_ppr_attribute10
,p_ppr_attribute11 => p_ppr_attribute11
,p_ppr_attribute12 => p_ppr_attribute12
,p_ppr_attribute13 => p_ppr_attribute13
,p_ppr_attribute14 => p_ppr_attribute14
,p_ppr_attribute15 => p_ppr_attribute15
,p_ppr_attribute16 => p_ppr_attribute16
,p_ppr_attribute17 => p_ppr_attribute17
,p_ppr_attribute18 => p_ppr_attribute18
,p_ppr_attribute19 => p_ppr_attribute19
,p_ppr_attribute20 => p_ppr_attribute20
,p_ppr_attribute21 => p_ppr_attribute21
,p_ppr_attribute22 => p_ppr_attribute22
,p_ppr_attribute23 => p_ppr_attribute23
,p_ppr_attribute24 => p_ppr_attribute24
,p_ppr_attribute25 => p_ppr_attribute25
,p_ppr_attribute26 => p_ppr_attribute26
,p_ppr_attribute27 => p_ppr_attribute27
,p_ppr_attribute28 => p_ppr_attribute28
,p_ppr_attribute29 => p_ppr_attribute29
,p_ppr_attribute30 => p_ppr_attribute30
,p_request_id => p_request_id
,p_program_application_id => p_program_application_id
,p_program_id => p_program_id
,p_program_update_date => p_program_update_date
,p_object_version_number => p_object_version_number
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'UPDATE_PRMRY_CARE_PRVDR'
,p_hook_type => 'BP'
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_action => 'UPDATE',
p_ext_ident => p_ext_ident,
p_old_ext_ident => l_old_pcp_values.ext_ident,
p_name => p_name,
p_old_name => l_old_pcp_values.name,
p_prmry_care_prvdr_typ_cd => p_prmry_care_prvdr_typ_cd,
p_old_prmry_care_prvdr_typ_cd => l_old_pcp_values.prmry_care_prvdr_typ_cd,
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id,
p_elig_cvrd_dpnt_id => l_old_pcp_values.elig_cvrd_dpnt_id,
p_prtt_enrt_rslt_id => l_old_pcp_values.prtt_enrt_rslt_id,
p_business_group_id => p_business_group_id,
p_effective_date => p_effective_date);
ben_PRMRY_CARE_PRVDR_bk2.update_PRMRY_CARE_PRVDR_a
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_prmry_care_prvdr_typ_cd => p_prmry_care_prvdr_typ_cd
,p_name => p_name
,p_ext_ident => p_ext_ident
,p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id
,p_elig_cvrd_dpnt_id => p_elig_cvrd_dpnt_id
,p_business_group_id => p_business_group_id
,p_ppr_attribute_category => p_ppr_attribute_category
,p_ppr_attribute1 => p_ppr_attribute1
,p_ppr_attribute2 => p_ppr_attribute2
,p_ppr_attribute3 => p_ppr_attribute3
,p_ppr_attribute4 => p_ppr_attribute4
,p_ppr_attribute5 => p_ppr_attribute5
,p_ppr_attribute6 => p_ppr_attribute6
,p_ppr_attribute7 => p_ppr_attribute7
,p_ppr_attribute8 => p_ppr_attribute8
,p_ppr_attribute9 => p_ppr_attribute9
,p_ppr_attribute10 => p_ppr_attribute10
,p_ppr_attribute11 => p_ppr_attribute11
,p_ppr_attribute12 => p_ppr_attribute12
,p_ppr_attribute13 => p_ppr_attribute13
,p_ppr_attribute14 => p_ppr_attribute14
,p_ppr_attribute15 => p_ppr_attribute15
,p_ppr_attribute16 => p_ppr_attribute16
,p_ppr_attribute17 => p_ppr_attribute17
,p_ppr_attribute18 => p_ppr_attribute18
,p_ppr_attribute19 => p_ppr_attribute19
,p_ppr_attribute20 => p_ppr_attribute20
,p_ppr_attribute21 => p_ppr_attribute21
,p_ppr_attribute22 => p_ppr_attribute22
,p_ppr_attribute23 => p_ppr_attribute23
,p_ppr_attribute24 => p_ppr_attribute24
,p_ppr_attribute25 => p_ppr_attribute25
,p_ppr_attribute26 => p_ppr_attribute26
,p_ppr_attribute27 => p_ppr_attribute27
,p_ppr_attribute28 => p_ppr_attribute28
,p_ppr_attribute29 => p_ppr_attribute29
,p_ppr_attribute30 => p_ppr_attribute30
,p_request_id => p_request_id
,p_program_application_id => p_program_application_id
,p_program_id => p_program_id
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'UPDATE_PRMRY_CARE_PRVDR'
,p_hook_type => 'AP' );
ROLLBACK TO update_PRMRY_CARE_PRVDR;
ROLLBACK TO update_PRMRY_CARE_PRVDR;
end update_PRMRY_CARE_PRVDR;
procedure update_prmry_care_prvdr_w
(
p_prmry_care_prvdr_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_prmry_care_prvdr_typ_cd in varchar2 default hr_api.g_varchar2
,p_name in varchar2 default hr_api.g_varchar2
,p_ext_ident in varchar2 default hr_api.g_varchar2
,p_prtt_enrt_rslt_id in number default hr_api.g_number
,p_elig_cvrd_dpnt_id in number default hr_api.g_number
,p_business_group_id in number default hr_api.g_number
,p_object_version_number in out nocopy number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_return_status out nocopy varchar2
)
is
--
l_proc varchar2(72) := g_package||'update_prmry_care_prvdr_w';
update_prmry_care_prvdr
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_prmry_care_prvdr_typ_cd => p_prmry_care_prvdr_typ_cd
,p_name => p_name
,p_ext_ident => p_ext_ident
,p_business_group_id => p_business_group_id
,p_object_version_number => l_object_version_number
,p_effective_date => p_effective_date
,p_datetrack_mode => p_datetrack_mode
);
end update_prmry_care_prvdr_w;
procedure delete_PRMRY_CARE_PRVDR
(p_validate in boolean default false
,p_prmry_care_prvdr_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_object_version_number in out nocopy number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_called_from in varchar2
) is
--
-- Declare cursors and local variables
--
l_proc varchar2(72) := g_package||'delete_PRMRY_CARE_PRVDR';
select pcp.prmry_care_prvdr_typ_cd,
pcp.name,
pcp.ext_ident,
pcp.prtt_enrt_rslt_id,
pcp.elig_cvrd_dpnt_id,
pcp.business_group_id,
pcp.effective_start_date
from ben_prmry_care_prvdr_f pcp
where pcp.prmry_care_prvdr_id = p_prmry_care_prvdr_id
and p_effective_date between pcp.effective_start_date and pcp.effective_end_date;
savepoint delete_PRMRY_CARE_PRVDR;
ben_PRMRY_CARE_PRVDR_bk3.delete_PRMRY_CARE_PRVDR_b
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_object_version_number => p_object_version_number
,p_effective_date => trunc(l_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'DELETE_PRMRY_CARE_PRVDR'
,p_hook_type => 'BP' );
(p_action => 'DELETE',
p_old_ext_ident => l_old_pcp_values.ext_ident,
p_old_name => l_old_pcp_values.name,
p_old_prmry_care_prvdr_typ_cd => l_old_pcp_values.prmry_care_prvdr_typ_cd,
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id,
p_elig_cvrd_dpnt_id => l_old_pcp_values.elig_cvrd_dpnt_id,
p_prtt_enrt_rslt_id => l_old_pcp_values.prtt_enrt_rslt_id,
p_business_group_id => l_old_pcp_values.business_group_id,
p_effective_date => l_effective_date);
ben_PRMRY_CARE_PRVDR_bk3.delete_PRMRY_CARE_PRVDR_a
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(l_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'DELETE_PRMRY_CARE_PRVDR'
,p_hook_type => 'AP'
);
ROLLBACK TO delete_PRMRY_CARE_PRVDR;
ROLLBACK TO delete_PRMRY_CARE_PRVDR;
end delete_PRMRY_CARE_PRVDR;
procedure delete_prmry_care_prvdr_w
(
p_prmry_care_prvdr_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_object_version_number in out nocopy number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_return_status out nocopy varchar2
)
is
l_proc varchar2(72) := g_package||'delete_prmry_care_prvdr_w';
delete_prmry_care_prvdr
(
p_prmry_care_prvdr_id => p_prmry_care_prvdr_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_object_version_number => l_object_version_number
,p_effective_date => p_effective_date
,p_datetrack_mode => p_datetrack_mode
);
end delete_prmry_care_prvdr_w;
select ecd.prtt_enrt_rslt_id,
ecd.business_group_id
from ben_elig_cvrd_dpnt_f ecd
where ecd.elig_cvrd_dpnt_id = p_elig_cvrd_dpnt_id
and p_effective_date between ecd.effective_start_date
and ecd.effective_end_date;
select pen.object_version_number,
pen.sspndd_flag
from ben_prtt_enrt_rslt_f pen
where pen.prtt_enrt_rslt_id = l_prtt_enrt_rslt_id
and pen.prtt_enrt_rslt_stat_cd is null
and pen.business_group_id = l_business_group_id
and p_effective_date
between pen.effective_start_date and pen.effective_end_date;