DBA Data[Home] [Help]

APPS.BEN_BENEFIT_CONTRIBUTIONS_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 20

procedure PARENT_DELETED (
					--
--***************************************************************************
--* Handles the case when a referenced master entity has one of its records *
--* deleted or shut down						    *
--***************************************************************************
					--
-- Parameters are:
					--
	-- Identifier of parent record
	p_parent_id	number,
					--
	p_delete_mode	varchar2	default 'DELETE',
	p_session_date	date		default trunc(sysdate),
					--
	-- Name of parent entity from which a deletion has been made
	p_parent_name	varchar2
					--
				) is
					--
cursor csr_orphaned_rows is
					--
	/*	Returns the set of rows whose foreign key references
		the deleted record. The decode determines which
		foreign key is used, thus the cursor applies to any
		parent entity.						*/
					--
	select	*
	from	ben_benefit_contributions_f
	where	p_parent_id	= decode (p_parent_name,
				'PAY_ELEMENT_TYPES_F', element_type_id,
				'PER_BUSINESS_GROUPS', business_group_id,
				'PER_COBRA_COVERAGE_BENEFITS_F',coverage_type)
	for update;
Line: 64

  if p_delete_mode = 'ZAP'
    or (p_delete_mode = 'DELETE'
	and p_session_date < fetched_benefit_contribution.effective_start_date )
  then
					--
    delete from ben_benefit_contributions_f
    where current of csr_orphaned_rows;
Line: 75

  elsif (p_delete_mode = 'DELETE'
  and p_session_date between fetched_benefit_contribution.effective_start_date
                         and fetched_benefit_contribution.effective_end_date)
  then
					--
    update ben_benefit_contributions_f
    set effective_end_date = p_session_date
    where current of csr_orphaned_rows;
Line: 88

end parent_deleted;