DBA Data[Home] [Help]

APPS.OTA_ELIG_PROFILE_UTIL SQL Statements

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

Line: 10

	SELECT paf.person_id
    	,  paf.assignment_id
      ,  paf.assignment_type
      ,  paf.business_group_id
    	FROM per_people_f ppf
	    ,per_assignments_f paf
	    ,per_person_type_usages_f ptu
	    ,per_person_types pts
	    ,per_business_groups pbg
	WHERE
      ppf.person_id = paf.person_id
	   AND ((pts.system_person_type IN ('EMP','CWK') AND paf.primary_flag = 'Y') OR (paf.assignment_type = 'A' AND pts.system_person_type ='APL'))
	   AND trunc(sysdate) BETWEEN ppf.effective_start_date AND ppf.effective_end_date
     AND trunc(sysdate) BETWEEN paf.effective_start_date AND paf.effective_end_date --added
     AND trunc(sysdate) BETWEEN trunc(ptu.effective_start_date) AND trunc(ptu.effective_end_date) --added
	   AND pts.person_type_id = ptu.person_type_id
	   AND ptu.person_id = ppf.person_id
	   AND pts.system_person_type IN ('EMP', 'CWK', 'APL')
	   AND paf.assignment_type IN ('A','E','C')
   AND (p_ota_global_bg_prof_val IS NOT NULL or pbg.business_group_id = p_per_bg_grp_prof_val)
--  AND pbg.business_group_id = p_per_bg_grp_prof_val
	AND paf.business_group_id = pbg.business_group_id
	AND
	((pts.system_person_type = 'APL'
	AND NOT EXISTS (SELECT person_id
	 FROM per_person_type_usages_f ptf,
	per_person_types ptp WHERE trunc(sysdate) BETWEEN trunc(ptf.effective_start_date) AND trunc(ptf.effective_end_date)
	AND ptf.person_type_id = ptp.person_type_id
	AND ptp.system_person_type IN ('EMP', 'CWK')
	AND ptf.person_id = ppf.PERSON_ID)
	)
	OR pts.system_person_type IN ('EMP', 'CWK'))
  order by paf.person_id;
Line: 48

	select
  nvl(processing_status,'A') processing_status_flag
	from
	ota_user_group_elements
	where
	user_group_id = p_user_group_id
	--and trunc(sysdate) between start_date_active and nvl(end_date_active,trunc(sysdate+1))
	--Adding above clause will not display members for end dated user groups
	and elig_prfl_id = p_eligibility_profile_id
	and person_id is null;
Line: 60

	select
   processing_status
	from
	ota_user_group_elements
	where
	user_group_id = p_user_group_id
	--and trunc(sysdate) between start_date_active and nvl(end_date_active,trunc(sysdate+1))
	--Adding above clause will not display members for end dated user groups
	and elig_prfl_id is not null
	and person_id is null
  and nvl(processing_status,'A') <> 'A';
Line: 104

	select
	user_group_name
	from  ota_user_groups_tl
	where
	user_group_id = p_ug_id
	and language = userenv('LANG');
Line: 129

	select person_id
	from
	ota_user_group_elements
	where
	user_group_id = p_user_group_id  and person_id= p_person_id
	and processing_status = nvl(p_processing_status,processing_status)
	and elig_prfl_id is not null
	and person_id is not null;
Line: 159

select elig_obj_id
  from ben_elig_obj_f
 where
TABLE_NAME = 'OTA_USER_GROUPS_B'
and COLUMN_NAME='USER_GROUP_ID'
and COLUMN_VALUE= p_user_group_id
and trunc(sysdate) between effective_start_date and effective_end_date;
Line: 190

    FND_FILE.PUT_LINE(FND_FILE.LOG,'Record exist for person_id : ' ||TO_CHAR(p_person_id) ||' user_group_id : ' ||TO_CHAR(p_user_group_id) ||' so update.Eligibility profile id is :  '||TO_CHAR(p_eligibility_profile_id));
Line: 193

	update ota_user_group_elements set processing_status= 'A' ,elig_prfl_id = p_eligibility_profile_id
	where
        user_group_id= p_user_group_id and
        person_id = p_person_id and
        elig_prfl_id is not null;
Line: 206

      insert into ota_user_group_elements(
      USER_GROUP_ELEMENT_ID,
      USER_GROUP_ID,
      BUSINESS_GROUP_ID,
      PERSON_ID,
      OBJECT_VERSION_NUMBER,
      CREATION_DATE,
      ELIG_PRFL_ID,
      processing_status)
      VALUES(
      ota_user_group_elements_s.nextval,
      p_user_group_id,
      p_business_group_id,
      p_person_id,
      l_object_version_number,
      sysdate,
      p_eligibility_profile_id,
      'A');
Line: 238

	select
	eligy_prfl_id,
	name,
	asmt_to_use_cd,
        business_group_id
	from ben_eligy_prfl_f
	where
	eligy_prfl_id = p_elig_prof_id
	and trunc(sysdate) between effective_start_date and effective_end_date
  and stat_cd in ('A','P');
Line: 299

                           (select user_group_id from ota_user_group_elements
                            where elig_prfl_id ='|| TO_CHAR(p_elig_prof_id)|| ')';
Line: 306

get_ug_to_be_processed :=	'select * from
  (select
	ug.user_group_id,
	uge.elig_prfl_id,
	uge.user_group_element_id,
	uge.business_group_id
	from
	ota_user_groups_b ug,
	ota_user_group_elements uge
	where
	ug.user_group_id = uge.user_group_id
	and trunc(sysdate) between trunc(ug.start_date_active) and nvl(ug.end_date_active,trunc(sysdate+1))
	and uge.elig_prfl_id is not null
	and uge.person_id is null
	and nvl(uge.processing_status,''A'') <> ''P''
	and ug.business_group_id = ota_general.get_business_group_id) QRSLT WHERE '|| ug_ep_whereclause ;
Line: 351

             update ota_user_group_elements set processing_status = 'P' --Parent record to Processing
	     where user_group_element_id = user_group_rec.user_group_element_id;
Line: 353

	     update ota_user_group_elements set processing_status = 'H' --Child records to history
	     where user_group_id = user_group_rec.user_group_id and elig_prfl_id =user_group_rec.elig_prfl_id  and person_id is not null;
Line: 386

        	l_sql_stmnt := 'select
        	* from(
        	select
        	person_id,
        	assignment_id,
          assignment_type,
          business_group_id
        	from
        	per_assignments_f
        	where
        	trunc(sysdate) between effective_start_date and effective_end_date
          and((assignment_type in (''E'',''C'') and PRIMARY_FLAG = ''Y'') OR (assignment_type = ''A''))
          and ((fnd_profile.value(''OTA_HR_GLOBAL_BUSINESS_GROUP_ID'') is not null and business_group_id = '||l_elig_pro_bg_id||') or (business_group_id = fnd_profile.value(''PER_BUSINESS_GROUP_ID''))))
         	QRSLT WHERE ' || assignment_whereclause;
Line: 454

            update ota_user_group_elements set processing_status= 'A'
        	  where user_group_element_id = user_group_rec.user_group_element_id;--set status of master record to A
Line: 468

 update ota_user_group_elements set processing_status= 'E' --Parent record to Error
 where user_group_element_id =l_learner_group_element_id;
Line: 581

		                           (select user_group_id from ota_user_group_elements
		                            where elig_prfl_id ='|| TO_CHAR(p_elig_prof_id)|| ')';
Line: 588

		     get_ug_to_be_processed :=	'select * from
		  (select
			ug.user_group_id,
            uge.elig_prfl_id,
			uge.user_group_element_id,
			uge.business_group_id
			from
			ota_user_groups_b ug,
			ota_user_group_elements uge
			where
			ug.user_group_id = uge.user_group_id
			and trunc(sysdate) between trunc(ug.start_date_active) and nvl(ug.end_date_active,trunc(sysdate+1))
			and uge.elig_prfl_id is not null
			and uge.person_id is null
			and nvl(uge.processing_status,''A'') in (''A'',''E'')
			and ug.business_group_id = ota_general.get_business_group_id) QRSLT WHERE '|| ug_whereclause ||
      ' order by user_group_id';
Line: 620

          update ota_user_group_elements set processing_status = fnd_global.conc_request_id --Parent record to Processing
		      where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
		      and elig_prfl_id is not null
		      and person_id is null
		      and BUSINESS_GROUP_ID = l_general_bg;
Line: 626

		      update ota_user_group_elements set processing_status = 'H' --Child records to history
			    where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
		      and elig_prfl_id is not null
		      and person_id is not null
		      and BUSINESS_GROUP_ID = l_general_bg;
Line: 781

				    update ota_user_group_elements set processing_status = 'A' --Parent record to completed
			      where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
            and nvl(processing_status,'A') <> 'E'
			      and elig_prfl_id is not null
			      and person_id is null
			      and BUSINESS_GROUP_ID = l_general_bg;
Line: 805

			    update ota_user_group_elements set processing_status = 'P' --Parent record to Processed
		      where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
		      and elig_prfl_id is not null
		      and person_id is null
		      and BUSINESS_GROUP_ID = l_general_bg;
Line: 824

			    update ota_user_group_elements set processing_status = 'E' --Parent record to Error
		      where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
		      and elig_prfl_id is not null
		      and person_id is null
		      and BUSINESS_GROUP_ID = l_general_bg;
Line: 845

select decode(PARENT_REQUEST_ID,-1,REQUEST_ID,PARENT_REQUEST_ID)
from fnd_concurrent_requests
where REQUEST_ID = p_conc_request_id;
Line: 892

    SELECT  ran.range_id
           ,ran.starting_person_action_id
           ,ran.ending_person_action_id
    FROM    OTA_BATCH_RANGES ran
    WHERE   ran.range_status_cd = 'U'
    AND     ran.batch_source_cd = 'EP'
    AND     ran.BATCH_ACTION_ID = p_action_id
    AND     rownum < 2
    FOR UPDATE OF ran.range_status_cd;
Line: 903

		SELECT  perf.person_id
		       ,perf.assignment_id
		       ,perf.mbr_bg_id
		FROM    ota_bulk_enr_req_members perf
    WHERE   perf.BULK_ENR_REQUEST_ID = p_action_id
		AND     perf.person_action_id BETWEEN l_start_person_action_id   AND  l_end_person_action_id
		ORDER BY perf.person_action_id;
Line: 915

    SELECT  DISTINCT
            asmt_to_use_cd
    FROM    ben_eligy_prfl_f
    WHERE   eligy_prfl_id = p_elig_prof_id
    AND     trunc (sysdate) BETWEEN effective_start_date
                            AND     effective_end_date
    AND     stat_cd IN ('A','P');
Line: 971

    ug_whereclause := 'user_group_id in (select user_group_id from ota_user_group_elements
                      			             where elig_prfl_id = '
                      || to_char (p_elig_prof_id)
                      || ' )';
Line: 979

  get_ug_to_be_processed := 'select * from
                             (select
                             ug.user_group_id user_group_id,
                             uge.elig_prfl_id elig_prfl_id,
                             uge.user_group_element_id user_group_element_id,
                             uge.business_group_id uge_business_group_id,
                             bep.business_group_id ep_business_group_id
                             from
                             ota_user_groups_b ug,
                             ota_user_group_elements uge,
                             ben_eligy_prfl_f bep
                             where
                             ug.user_group_id = uge.user_group_id
                             and trunc(sysdate) between trunc(ug.start_date_active) and nvl(ug.end_date_active,trunc(sysdate+1))
                             and uge.elig_prfl_id is not null
                             and uge.person_id is null
                             and bep.eligy_prfl_id = uge.elig_prfl_id
							 and trunc(sysdate) between bep.effective_start_date AND bep.effective_end_date
                          	 and bep.stat_cd IN (''A'',''P'')
                             and nvl(uge.processing_status,''A'') = '''
                            || to_char (conc_parent_request_id(fnd_global.conc_request_id))
                            || ''' and ug.business_group_id = ota_general.get_business_group_id) QRSLT WHERE '
                            || ug_whereclause
                            || ' order by user_group_id';
Line: 1034

    UPDATE  OTA_BATCH_RANGES ran
    SET     ran.range_status_cd = 'P'
    WHERE   ran.range_id = l_range_id;
Line: 1115

                l_score_tab.delete;
Line: 1121

        UPDATE  ota_bulk_enr_req_members
        SET     action_status_cd = 'P'
        WHERE   person_id = l_rec.person_id
        AND     BULK_ENR_REQUEST_ID = p_action_id
        AND     action_status_cd <> 'P';
Line: 1127

        lrnr_rec.delete;
Line: 1129

	   update ota_bulk_enr_req_members set action_status_cd = 'P'
	   WHERE   BULK_ENR_REQUEST_ID = p_action_id
	   AND     action_status_cd <> 'P'
	   AND     person_action_id BETWEEN l_start_person_action_id
	                            AND     l_end_person_action_id;
Line: 1137

  user_elig_pro_rec.delete;
Line: 1138

  l_eligprof_tab.delete;
Line: 1164

				    update ota_user_group_elements set processing_status = 'E' --Parent record to Error
			      where user_group_id = user_elig_pro_rec(ug_print_count).user_group_id
			      and elig_prfl_id is not null
			      and person_id is null
			      and BUSINESS_GROUP_ID = l_ota_general_bg;
Line: 1187

procedure delete_ineligible_records(errbuf out nocopy  varchar2,
                                      retcode out nocopy varchar2,
                                      p_learner_group_id in number,
                                      p_elig_prof_id in number) is

--user_group_rec get_ug_to_be_processed%rowtype;
Line: 1225

                           (select user_group_id from ota_user_group_elements
                            where elig_prfl_id ='|| TO_CHAR(p_elig_prof_id)|| ')';
Line: 1232

get_ug_to_be_processed :=	'select * from
  (select
	ug.user_group_id,
	uge.elig_prfl_id,
	uge.user_group_element_id,
	uge.business_group_id
	from
	ota_user_groups_b ug,
	ota_user_group_elements uge
	where
	ug.user_group_id = uge.user_group_id
	and trunc(sysdate) between trunc(ug.start_date_active) and nvl(ug.end_date_active,trunc(sysdate+1))
	and uge.elig_prfl_id is not null
	and uge.person_id is null
	and nvl(uge.processing_status,''A'') <> ''P''
	and ug.business_group_id = ota_general.get_business_group_id) QRSLT WHERE '|| ug_ep_whereclause ;
Line: 1268

           delete from ota_user_group_elements uge where
          	uge.person_id is not null and
            uge.elig_prfl_id is not null and
            uge.processing_status = 'H' and
            uge.user_group_id = user_group_rec.user_group_id and
            uge.elig_prfl_id =  user_group_rec.elig_prfl_id
            and exists
              	(
              	select user_group_element_id from
              	ota_user_group_elements parent
              	where
              	 parent.elig_prfl_id = uge.elig_prfl_id
              	and parent.user_group_id = uge.user_group_id
              	and nvl(parent.processing_status,'A') = 'A'
              	and parent.person_id is null
              	);
Line: 1297

  update ota_user_group_elements set processing_status= 'E' --Parent record to Error
  where user_group_element_id =l_learner_group_element_id;
Line: 1303

end delete_ineligible_records;
Line: 1311

	select user_group_id
	from
	ota_user_group_elements
	where
	elig_prfl_id=p_elig_prof_id;
Line: 1343

	select
	elig_obj_id
	from
	ben_elig_obj_f EO
	where
	trunc(sysdate) between EFFECTIVE_START_DATE and EFFECTIVE_END_DATE
	and TABLE_NAME = 'OTA_USER_GROUPS_B'
	and COLUMN_NAME = 'USER_GROUP_ID'
	and COLUMN_VALUE = p_user_group_id;
Line: 1431

procedure delete_eligibility_object(
	p_user_group_id in varchar2,
  p_eligibility_profile_id in varchar2,
	p_result out nocopy varchar) is

	cursor get_elig_object_id (p_user_group_id in number) is
	select
	elig_obj_id ,
	object_version_number
	from
	ben_elig_obj_f EO
	where
	trunc(sysdate) between EFFECTIVE_START_DATE and EFFECTIVE_END_DATE
	and TABLE_NAME = 'OTA_USER_GROUPS_B'
	and COLUMN_NAME = 'USER_GROUP_ID'
	and COLUMN_VALUE = p_user_group_id;
Line: 1451

	select
	elig_obj_elig_prfl_id
	from
	ben_elig_obj_elig_profl_f
	where
	trunc(sysdate) between effective_start_date and effective_end_date
	and elig_obj_id = p_elig_obj_id
  and rownum < 2;
Line: 1470

	savepoint delete_eligibility_object;
Line: 1478

    ROLLBACK TO delete_eligibility_object;
Line: 1486

	  ben_elig_obj_elig_profl_api.delete_elig_obj_elig_profl
	  (p_validate               => false
	  ,p_elig_obj_elig_prfl_id  => l_elig_obj_elig_prf_id
	  ,p_effective_start_date   => l_effective_start_date
	  ,p_effective_end_date     => l_effective_end_date
	  ,p_object_version_number  => l_elig_obj_obj_version
	  ,p_effective_date         => trunc(sysdate)
	  ,p_datetrack_mode         =>  hr_api.g_zap
	  );
Line: 1501

	   	ben_elig_obj_api.delete_ELIG_OBJ
		  (p_validate                  => false
		  ,p_elig_obj_id               => l_elig_object_id
		  ,p_effective_start_date      => l_effective_start_date
		  ,p_effective_end_date        => l_effective_end_date
		  ,p_object_version_number     => l_obj_version
		  ,p_effective_date            => trunc(sysdate)
		  ,p_datetrack_mode            => hr_api.g_zap
		  );
Line: 1514

    delete from ota_user_group_elements
    where user_group_id=p_user_group_id and
    elig_prfl_id=l_elig_prof_id and
    person_id is not null;
Line: 1525

	   ROLLBACK TO delete_eligibility_object;
Line: 1527

end delete_eligibility_object;
Line: 1581

    Select null
      From fnd_concurrent_requests fnd
     Where fnd.phase_code <> 'C'
       And fnd.request_id = p_request_id;