DBA Data[Home] [Help]

APPS.PAY_KR_YEA_DON_EFILE_PKG SQL Statements

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

Line: 16

        select  count(distinct hoi2.org_information2||hoi3.org_information9)
         from    hr_organization_information     hoi3,
                 hr_organization_information     hoi2,
                 hr_organization_units           bp2,
                 hr_organization_information     hoi1,
                 hr_organization_units           bp1
         where   bp1.organization_id           = g_business_place_id
         and     hoi1.organization_id          = bp1.organization_id
         and     hoi1.org_information_context  = 'KR_BUSINESS_PLACE_REGISTRATION'
         and     bp2.business_group_id         = bp1.business_group_id
         and     (      (report_for_var = 'A')
    		     or (        (hoi2.organization_id  in ( select posev.ORGANIZATION_ID_child
 							     from   PER_ORG_STRUCTURE_ELEMENTS posev
							     where  posev.org_structure_version_id=(pay_magtape_generic.get_parameter_value('ORG_STRUC_VERSION_ID'))
								    and exists ( select null
										 from   hr_organization_information
										 where  organization_id = posev.ORGANIZATION_ID_child
											and org_information_context = 'CLASS'
											and org_information1 = 'KR_BUSINESS_PLACE'
										)
								    start with ORGANIZATION_ID_PARENT = (decode(report_for_var,'S',null,'SUB',g_business_place_id))
								    connect by prior ORGANIZATION_ID_child = ORGANIZATION_ID_PARENT
							    )
				  )
         		       or (hoi2.organization_id = g_business_place_id
				  )
			 )
		 )
         and     hoi2.organization_id          = bp2.organization_id
         and     hoi2.org_information_context  = 'KR_BUSINESS_PLACE_REGISTRATION'
         and     hoi2.org_information10        = hoi1.org_information10
         and     hoi3.organization_id          = hoi2.organization_id
         and     hoi3.org_information_context  = 'KR_INCOME_TAX_OFFICE'
         and     exists(
                         select  null
                         from    pay_assignment_actions  paa,
                                 pay_payroll_actions     ppa
                         where   ppa.report_type       = 'YEA'
                         and     ppa.report_qualifier  = 'KR'
                         and     ppa.business_group_id = bp1.business_group_id
                         -- Bug 3248513
	                 and     ( (ppa.report_category in (g_normal_yea, g_interim_yea, g_re_yea)) or (ppa.payroll_action_id = g_payroll_action_id) )
                         and     to_number(to_char(ppa.effective_date, 'YYYY')) = g_target_year
                         --
                         and     ppa.action_type in ('B','X')
                         and     paa.payroll_action_id = ppa.payroll_action_id
                         and     paa.tax_unit_id       = bp2.organization_id
                         and     paa.action_status     = 'C');