You are on page 1of 1

SELECT DISTINCT hou.

name Op_unit
, pj.name job_code
, pcf.control_function_name
, pcga.control_group_name
, pcr.rule_type_code
, pcr.object_code
, to_char(pcr.amount_limit) amount_limit
, (pcr.segment1_low || '.' || pcr.segment2_low || '.' ||
pcr.segment3_low || '.' || pcr.segment4_low || '.' ||
pcr.segment5_low || '.' || pcr.segment6_low || '.' ||
pcr.segment7_low || '.' || pcr.segment8_low || '.' ||
pcr.segment9_low || '.' || pcr.segment10_low || '.' ||
pcr.segment11_low || '.' || pcr.segment12_low
) account_range_low
, (pcr.segment1_high || '.' || pcr.segment2_high || '.' ||
pcr.segment3_high || '.' || pcr.segment4_high || '.' ||
pcr.segment5_high || '.' || pcr.segment6_high || '.' ||
pcr.segment7_high || '.' || pcr.segment8_high || '.' ||
pcr.segment9_high || '.' || pcr.segment10_high || '.' ||
pcr.segment11_high || '.' || pcr.segment12_high
) account_range_high
FROM po_position_controls_all ppca
, po_control_groups_all pcga
, po_control_functions pcf
, po_control_rules pcr
, per_jobs pj
, hr_all_organization_units hou
WHERE 1 = 1
and ppca.control_group_id = pcga.control_group_id
AND pcr.control_group_id = ppca.control_group_id
AND ppca.control_function_id = pcf.control_function_id
AND ppca.org_id = hou.organization_id
AND ppca.org_id = pcga.org_id
AND pj.job_id = ppca.job_id
AND trunc(SYSDATE) BETWEEN ppca.start_date AND nvl(ppca.end_date, SYSDATE + 1)
AND pcf.enabled_flag = 'Y'
AND pcga.enabled_flag = 'Y'
and hou.name in ( 'ST DTC Germany'
, 'ST DTC United States'
, 'ST Poland'
)
ORDER BY hou.name
, pcf.control_function_name
, pcga.control_group_name
, pcr.object_code
, pcr.rule_type_code DESC
, amount_limit
;

You might also like