0% found this document useful (0 votes)
202 views6 pages

IC Queries

The document contains SQL queries for retrieving various types of information from compensation plan and participant databases, such as transaction details, calculation logs, participant details, plan component details, goal assignments, and more. The queries are organized by comment headings indicating the purpose or object of each query.

Uploaded by

nitinjain2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
202 views6 pages

IC Queries

The document contains SQL queries for retrieving various types of information from compensation plan and participant databases, such as transaction details, calculation logs, participant details, plan component details, goal assignments, and more. The queries are organized by comment headings indicating the purpose or object of each query.

Uploaded by

nitinjain2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

--How to check transactions

---------------------------------------------select source_trx_number, transaction_id, source_event_date, credit_date, transa


ction_type, eligible_cat_id, source_type, object_status, collection_status, adju
stment_status, process_code, org_id, sales_channel, reason_code, clsfn_rule_id,
created_by, creation_date, attribute_number2, attribute_number3,
attribute_number15, role_id
from cn_tp_transactions_all
where source_trx_number like :trx_number
-- How to debug calculation program
---------------------------------------------select l.message_text
from cn_process_audits_all a, cn_process_audit_lines_all l
where a.request_id = :process_id
and a.process_audit_id = l.process_audit_id
order by l.process_audit_line_id
-- To get the participant information
---------------------------------------------select cspa.org_id "BUSINESS_UNIT",
hzp.PARTY_NAME "PARTICIPANT_NAME",
cspa.participant_id "PARTICIPANT_ID",
trunc(hzp.LAST_UPDATE_DATE) "LAST_UPDATE_DATE"
from hz_parties hzp,
cn_srp_participants_all cspa
where cspa.party_id = hzp.party_id
order by hzp.party_name
--To get all IDs of plan components of a respective comp plan
---------------------------------------------select srp_comp_plan_id, comp_plan_component_id, plan_component_id, creation_dat
e, org_id
from cn_srp_plan_components_all
where plan_component_id = :plan_component_id
-- How to get the expression detail
---------------------------------------------select n.expression_id, n.expression_name, d.item_display_value,
d.item_source_type, e.expression_type, e.rendered_expression_disp,
e.sql_select, e.sql_from, e.piped_sql_from
from cn_expressions_all_tl n, cn_expression_details_all d, cn_expressions_all_b
e
where n.expression_name = :expression_name
and n.expression_id = d.expression_id
and n.expression_id = e.expression_id
-- Get Participant name with Trailing spaces
---------------------------------------------select participant_id, org_id, participant_name,
trim(participant_name)
from cn_srp_participants_all
where participant_name like '% '

order by participant_name, org_id


-- Get Package Name
---------------------------------------------select line, text from all_source
where type = 'PACKAGE BODY'
and name = :package_name order by line
--Participant with Trailing Spaces
---------------------------------------------select party_id, party_name, person_first_name, person_last_name, creation_date,
created_by
from HZ_PARTIES
where party_type = 'PERSON'
--and party_name like '% '
-- Get Business Unit Name
---------------------------------------------select distinct bu.bu_id, bu.bu_name
from fun_all_business_units_v bu,
fun_business_functions_b bf,
fun_bu_usages_v buu
where bu.bu_id = buu.business_unit_id
and bf.business_function_code = 'INCENTIVE_COMPENSATION_BF'
and bf.business_function_id = buu.module_id
-- How to get import jobs
---------------------------------------------select import_job_id, cdm_batch_id, name, desc_text, object_type_cd,
import_map_id, request_id, creation_date, created_by
from mkt_imp_jobs
where name like :import_name
and creation_date between :start_date and :end_date
-- Get classification Rules
---------------------------------------------select * from cn_rs_rules_all_tl where rule_id = :rule_id
-- Compensation Plan Assignment Id
---------------------------------------------select srp_comp_plan_id, s.comp_plan_id, comp_plan_name
from cn_srp_comp_plans_all s, cn_comp_plans_all_vl c
where s.srp_comp_plan_id = :srp_comp_plan_id
and s.comp_plan_id = c.comp_plan_id
-get comp plan name
---------------------------------------------select srp_comp_plan_id, s.comp_plan_id, comp_plan_name
from cn_srp_comp_plans_all s, cn_comp_plans_all_vl c
where s.srp_comp_plan_id = :srp_comp_plan_id
and s.comp_plan_id = c.comp_plan_id
--formula name
---------------------------------------------select formula_id, formula_name, formula_type_code, package_name
from cn_formulas_all_vl
where formula_id = :formula_id
-- Get Comp Plan detail

---------------------------------------------select plan_component_id, plan_component_name, incentive_type, start_date, end_d


ate, approval_status, description, calc_variable_id
from cn_plan_components_all_vl
where plan_component_id = :plan_component_id
or plan_component_name like :plan_component_name
--Team_PlanComp
---------------------------------------------SELECT pc.plan_component_id, pc.plan_component_name,
sp.period_name start_period,
sp.period_id start_period_id,
ep.period_name end_period
FROM cn_plan_components_all_vl pc,
cn_periods_vl sp,
cn_periods_vl ep
WHERE sp.period_year = :calendar_year
AND pc.start_date BETWEEN sp.start_date AND sp.end_date
AND sp.calendar_id = (SELECT calendar_id FROM
cn_repositories_all_b WHERE org_id = pc.org_id)
AND ep.period_year = :calendar_year
AND pc.end_date BETWEEN ep.start_date AND ep.end_date
AND ep.calendar_id = (SELECT calendar_id FROM
cn_repositories_all_b WHERE org_id = pc.org_id )
AND pc.plan_component_id IN (SELECT spc.plan_component_id
FROM cn_srp_plan_components_all spc,
cn_srp_comp_plans_all scp
WHERE scp.srp_comp_plan_id = spc.srp_comp_plan_id
AND scp.participant_id IN (SELECT p.participant_id
FROM cn_srp_participants_all p
WHERE p.source_system_id in (SELECT pp.person_id FROM per_users pp WHERE p
p.user_guid = :user_login
UNION ALL
SELECT pas.person_id
FROM per_assignment_supervisors_f_v pas
WHERE TRUNC(sysdate) BETWEEN pas.effective_start_date AND pas.effective_en
d_date
AND pas.primary_flag = 'Y'
AND pas.manager_id =
(SELECT pp.person_id
FROM per_users pp
WHERE pp.user_guid = FND_GLOBAL.user_guid
))))
-- To get Manager
---------------------------------------------SELECT pas.person_id, effective_start_date, effective_end_date, manager_id, pri
mary_flag
FROM per_assignment_supervisors_f_v pas
WHERE manager_id = :manager_id
-- to get user name
---------------------------------------------select person_id, user_guid, username from per_users where username = :username
-- Performance Measure Goal Assigned
---------------------------------------------select p.comp_plan_id, p.srp_comp_plan_id, c.plan_component_id,
f.srp_form_metric_id, f.formula_id, fn.formula_name "PERFORMANCE MEASURE",
f.goal_id, g.target, fn.unit_of_measure,

g.srp_goal_id, pi.srp_interval_goal_id, pi.interval_number, pi.target_int,


pg.period_id, pg.target_per, pg.target_itd, p.target_incentive
from cn_srp_comp_plans_all p,
cn_srp_plan_components_all c,
cn_srp_form_metrics_all f,
cn_formulas_all_vl fn,
cn_srp_goals_all g,
cn_srp_interval_goals_all pi,
cn_srp_per_goals_all pg
where p.participant_id = :participant_id
and p.srp_comp_plan_id = c.srp_comp_plan_id
and p.srp_comp_plan_id = f.srp_comp_plan_id
and c.srp_plan_component_id = f.srp_plan_component_id
and f.goal_id is not null -- performance measure
and f.formula_id = fn.formula_id
and f.srp_form_metric_id = g.srp_form_metric_id
and g.srp_goal_id = pi.srp_goal_id
and pi.srp_interval_goal_id = pg.srp_interval_goal_id
order by p.comp_plan_id, p.srp_comp_plan_id, c.plan_component_id, f.formula_id,
pi.interval_number, pg.period_id
-- plan component by year
---------------------------------------------SELECT pc.plan_component_id, pc.plan_component_name,
sp.period_name start_period,
sp.period_id start_period_id,
ep.period_name end_period
FROM cn_plan_components_all_vl pc,
cn_periods_vl sp,
cn_periods_vl ep
WHERE sp.period_year = :b_calendar_year
AND pc.start_date BETWEEN sp.start_date AND sp.end_date
AND sp.calendar_id =
(SELECT calendar_id FROM cn_repositories_all_b WHERE org_id = pc.org_id
)
AND ep.period_year = :b_calendar_year
AND pc.end_date BETWEEN ep.start_date AND ep.end_date
AND ep.calendar_id =
(SELECT calendar_id FROM cn_repositories_all_b WHERE org_id = pc.org_id
)
--Performance Measure Goals at Participant Level without Parameter
---------------------------------------------select p.participant_id,p.comp_plan_id, p.srp_comp_plan_id, c.plan_component_id,
f.srp_form_metric_id, f.formula_id, fn.formula_name "PERFORMANCE MEASURE",
f.goal_id, g.target, fn.unit_of_measure,
g.srp_goal_id, pi.srp_interval_goal_id, pi.interval_number, pi.target_int,
pg.period_id, pg.target_per, pg.target_itd, p.target_incentive
from cn_srp_comp_plans_all p,
cn_srp_plan_components_all c,
cn_srp_form_metrics_all f,
cn_formulas_all_vl fn,
cn_srp_goals_all g,
cn_srp_interval_goals_all pi,
cn_srp_per_goals_all pg
where 1=1
-p.participant_id = :participant_id
and p.srp_comp_plan_id = c.srp_comp_plan_id
and p.srp_comp_plan_id = f.srp_comp_plan_id
and c.srp_plan_component_id = f.srp_plan_component_id

and f.goal_id is not null -- performance measure


and f.formula_id = fn.formula_id
and f.srp_form_metric_id = g.srp_form_metric_id
and g.srp_goal_id = pi.srp_goal_id
and pi.srp_interval_goal_id = pg.srp_interval_goal_id
and rownum <=20
order by p.comp_plan_id, p.srp_comp_plan_id, c.plan_component_id, f.formula_id,
pi.interval_number, pg.period_id
--------------------------------------------------------------------------------- Participants having roles
SELECT
cspa.org_id
"BUSINESS_UNIT",
crb.role_name
"role_name_t",
fab.bu_name
BU_Name,
hzp.PARTY_NAME
"PARTICIPANT_NAME",
sysdate
AssignmentStartDate,
NULL
AssignmentEndDate,
cspa.party_number
PartyNumber,
hzp.party_id
Party_id,
hzp.email_address
email_address,
cspa.participant_id "PARTICIPANT_ID",
trunc(hzp.LAST_UPDATE_DATE) "LAST_UPDATE_DATE"
FROM
hz_parties hzp,
cn_srp_participants_all cspa,
fun_all_business_units_v fab,
CN_PARTICIPANT_ROLES CPR ,
CN_ROLES_tl
crb
where cspa.party_id = hzp.party_id
and cspa.participant_id = cpr.participant_id
and cpr.role_id = crb.role_id
and upper(crb.role_name) = upper('DSI Footprint')
--and upper(crb.role_name) = upper('rel_8_upgrade_rep')
and fab.bu_name like 'Test_BU'
--and fab.bu_name like 'ED Business Unit'
--and hzp.PARTY_NAME like 'ED%'
and cspa.org_id = fab.bu_id
order by hzp.party_name
--------------------------------------------------------------------------------- Participants details
SELECT
-- Role is not attached to participant that's why hardcode for webservices
'rel_8_upgrade_rep' Role_Name,
fab.bu_name
BU_Name,
hzp.PARTY_NAME
"PARTICIPANT_NAME",
sysdate
AssignmentStartDate,
NULL
AssignmentEndDate,
cspa.party_number
PartyNumber,
hzp.party_id
Party_id,
hzp.email_address
email_address,
cspa.participant_id "PARTICIPANT_ID",
trunc(hzp.LAST_UPDATE_DATE) "LAST_UPDATE_DATE"

FROM
hz_parties hzp,
cn_srp_participants_all cspa,
fun_all_business_units_v fab
WHERE cspa.party_id = hzp.party_id
AND cspa.org_id = fab.bu_id
AND fab.bu_name like 'ED Business Unit'
AND hzp.PARTY_NAME like 'ED%'
order by hzp.party_name

You might also like