Search for:
Reports (BIP) – Query to get learning outcomes

Oracle Learning Cloud supports to define learning outcomes against each course as shown in below fig:

For reporting and integration purposes, there is a need to extract the learning outcomes assigned against each course. Learning outcomes are stored as profile relationship against each course. Below query can be used to extract the asked data:

select wlifv.learning_item_number,
wlifv.name learning_item_name,
wlifv.learning_item_type,
wlifv.status,
wlifv.effective_start_date,
wlifv.effective_end_date,
hpi.content_type_id,
hpi.date_from,
hpi.date_to,
hpi.content_item_id competency_id,
hctt.content_type_name,
hcit.name content_item_name
from HRT_RELATION_CONFIG_B hrcb
,HRT_PROFILE_RELATIONS hpr
,HRT_CONTENT_TYPES_B hctb
,HRT_CONTENT_TYPES_TL hctt
,HRT_CONTENT_ITEMS_TL hcit
,HRT_PROFILE_ITEMS hpi
,HRT_PROFILES_B hpb
,WLF_LEARNING_ITEMS_F_VL wlifv
where hrcb.key_table_name = 'WLF_LEARNING_ITEMS_F_VL'
and hrcb.relation_code = 'LEARNING_ITEM'
and hrcb.relation_id = hpr.relation_id
and hpi.profile_id = hpr.profile_id
and hpi.content_type_id = hctb.content_type_id
and hctt.content_type_id = hctb.content_type_id
and hctb.context_name = 'COMPETENCY'
and hpi.profile_id = hpb.profile_id
and hpr.object_id = wlifv.learning_item_id
and hpb.profile_usage_code = 'L'
and hpi.content_item_id = hcit.content_item_id
and TRUNC(SYSDATE) BETWEEN wlifv.effective_start_date and wlifv.effective_end_date
and hctt.language = 'US'
and hcit.language = 'US'
ORDER BY 1
Reports (BIP) – Query to find module type and key

While defining Common Lookups or value sets, you need to provide module value. Each module has an associated module type, module key and product code associated with it. For example:

These details are stored in backed in a table – FND_APPL_TAXONOMY.

Use the below query to find module type, module key etc for a module:

select fat.MODULE_NAME
,fat.MODULE_TYPE
,fat.MODULE_KEY
,fat.PRODUCT_CODE
from FND_APPL_TAXONOMY fat
Data Masking – Mask Salary Data in lower environment

There is a common requirement to mask salary data post P2T refreshes. This should be done in order to hide the actual salaries information as salary is a very sensitive information.

Use the below query to generate data in HDL format in a test environment immediately after P2T refresh. The below query generate a random salary amount. Save the downloaded data in .dat file format and upload it back to the instance.

Select 'METADATA|Salary|AssignmentNumber|SalaryAmount|DateFrom|DateTo|SalaryBasisId|SalaryId' Header, 1 data_flow_order
from dual
UNION
SELECT 'MERGE|Salary'||'|'||
paam.assignment_number||'|'||
round(DBMS_RANDOM.VALUE (1,15000) , 2)||'|'||
TO_CHAR(cs.date_from,'RRRR/MM/DD', 'nls_date_language=American')||'|'||
TO_CHAR(cs.date_to,'RRRR/MM/DD', 'nls_date_language=American')||'|'||
cs.salary_basis_id||'|'||
cs.salary_id data_row,
2 data_flow_order
FROM cmp_salary cs,
per_all_assignments_m paam
WHERE cs.assignment_id= paam.assignment_id
AND trunc(sysdate) between paam.effective_start_date AND paam.effective_end_date
AND paam.assignment_type in ('E', 'C', 'P')
AND paam.assignment_number ='E788880'
ORDER BY data_flow_order

Reports (BIP) – Query to extract seniority dates setup
select hr_general.decode_lookup('ORA_PER_SENIORITY_ITEMS',psds.seniority_date_code) seniority_date_code_meaning
,hr_general.decode_lookup('ORA_PER_SENIORITY_LEVELS',psds.level_code) level_code_meaning
,hr_general.decode_lookup('ORA_PER_TRIG_FIELDS',psds.triggering_field) triggering_field_meaning
,psds.active_flag
,psds.allow_edit_flag
,psds.display_in_ui
,psds.cumulative_flag
,psds.hours_in_year
,psds.hours_in_month
,psds.hours_in_day
,psds.object
,psds.source_field
,psds.seniority_version
,psds.record_creator
,psds.setup_seniority_basis
from per_seniority_dates_setup psds
Reports (BIP) – User Role Details
SELECT distinct pu.username
,prd.role_common_name
,prd.abstract_role
,prd.job_role
,prd.data_role
,prd.delegation_allowed
,prd.active_flag
,prdt.role_name
,prdt.description
FROM per_users pu
,per_roles_dn prd
,per_user_roles pur
,per_roles_dn_tl prdt
WHERE pu.user_id = pur.user_id
and pur.role_id = prdt.role_id
and pur.role_id = prd.role_id
and prdt.language = 'US'
Reports (BIP) – Query to get Department Manager Name
SELECT distinct houft.name, 
       ppnfv.full_name
FROM HR_ORGANIZATION_INFORMATION_F hoif,
     per_person_names_f_v ppnfv,
     hr_organization_units_f_tl houft
WHERE trunc(sysdate) BETWEEN hoif.EFFECTIVE_START_DATE AND hoif.EFFECTIVE_END_DATE
AND trunc(sysdate) BETWEEN ppnfv.effective_Start_date AND ppnfv.effective_end_date
AND ppnfv.person_id=hoif.ORG_INFORMATION2
AND houft.organization_id = hoif.organization_id
AND hoif.ORG_INFORMATION_CONTEXT = 'PER_ORG_MANAGER_INFO'
AND houft.language = 'US'
AND TRUNC(sysdate) BETWEEN houft.EFFECTIVE_START_DATE AND houft.EFFECTIVE_END_DATE
BIP (Reports) – Query to extract Accrual details
select papf.person_number,
aapft.name aapftan_name ,
apae.begin_bal,
apae.accrued,
apae.used,
apae.accrual_period,
apae.end_bal,
apae.first_last_prd_in_aapft_term
from per_all_peoaapfte_f papf,
anc_per_accrual_entries apae,
anc_absence_aapftans_f_tl aapft
where 1=1
and papf.person_id = apae.person_id
and apae.aapftan_id= aapft.absence_aapftan_id
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and aapft.language ='US'
and trunc(sysdate) between aapft.effective_start_date and aapft.effective_end_date
and apae.accrual_period <= TO_DATE('2021/12/31','YYYY/MM/DD')
Reports (BIP) – Basic Query for Checklist E-sign Report

Oracle provided a new functionality to include e signatures in checklist tasks. A custom report can be configured and upon e-signature and completion, it will be saved to worker’s document of records.

You can follow the below document on my oracle support for detailed steps – 2611795.1

Below is the basic SQL query to start the data model development. You can add additional tables/columns as per your need.

SELECT DISTINCT Person.PERSON_ID
,PAT.ALLOCATED_CHECKLIST_ID AS P_ALLOCATED_CHECKLIST_ID
--,PAT.ALLOCATED_TASK_ID AS TASK_ID
,PersonName.FULL_NAME FULL_NAME
,PersonName.DISPLAY_NAME DISPLAY_NAME
,PersonName.first_name FIRST_NAME
,PersonName.last_name LAST_NAME
,PersonName.middle_names MIDDLE_NAMES
,to_char(Person.date_of_birth,'DD-MM-RRRR', 'nls_date_language=American') DOB
,(SELECT flv.meaning
FROM FND_LOOKUP_VALUES flv
WHERE flv.lookup_type = 'TITLE'
AND flv.language = 'US'
AND flv.lookup_code = PersonName.title) TITLE
--,PAT.SIGNER_NAME AS P_SIGNER_NAME
--,TO_CHAR(PAT.SIGN_DATE,'MM/DD/YY') AS P_SIGN_DATE
,:P_SIGNER_NAME P_SIGNER_NAME
,:P_SIGN_DATE P_SIGN_DATE
FROM PER_PERSONS Person,
PER_PERSON_NAMES_F PersonName,
PER_ALLOCATED_CHECKLISTS PAC,
PER_ALLOCATED_TASKS_VL PAT
WHERE PAC.ALLOCATED_CHECKLIST_ID = NVL(:P_ALLOCATED_CHECKLIST_ID,PAC.ALLOCATED_CHECKLIST_ID)
AND PAC.ALLOCATED_CHECKLIST_ID=PAT.ALLOCATED_CHECKLIST_ID
AND PAT.PERFORMER_ORIG_SYS_ID = Person.PERSON_ID
AND PersonName.PERSON_ID = Person.PERSON_ID
AND PersonName.NAME_TYPE = 'GLOBAL'
AND GREATEST(TRUNC(PAC.ACTION_DATE),TRUNC(SYSDATE)) BETWEEN LEAST(TRUNC(SYSDATE),PersonName.EFFECTIVE_START_DATE) AND PersonName.EFFECTIVE_END_DATE
AND PAT.STATUS='COM'
AND PAT.allocated_task_id=3000012222113131
BIP Reports – Query to get Position Profile Attachment details

While creating a position profile, there is an option to add the attachments. In order to get the various details of the attachment like name, UCM content ID etc, please use the below query:

select hpb.PROFILE_TYPE_ID,
       PROFILE_CODE,
       PROFILE_STATUS_CODE,
       PROFILE_USAGE_CODE,
       fad.CATEGORY_NAME ,
       fdt.file_name,
       fdt.dm_version_number document_id,
       fdt.dm_document_id UCM_file
  from fnd_attached_documents fad, HRT_PROFILES_B hpb, fnd_documents_tl fdt
 where ENTITY_NAME = 'HRT_PROFILES_B'
   and hpb.profile_id = fad.PK1_VALUE
   AND fad.document_id = fdt.document_id
   AND fdt.language = 'US'

In order to download the attchments from UCM, the user should have AttachmentsRead role attached. Please check the below post on how to create AttachmentsRead role:

https://fusionhcmconsulting.com/2021/03/security-role-to-view-document-of-record-attachments-on-ucm/

Configuration – Extract DFF Setup

Use below query to extract the DFF setups defined in Fusion:

SELECT
 fdsv.descriptive_flexfield_code
      ,fdsv.context_code
      ,fdsv.segment_code
      ,fdsv.name
      ,fdsv.column_name
      ,fvvs.value_set_code
      ,fdsv.display_type
      ,fdsv.prompt
      ,fdsv.short_prompt
      ,fdsv.enabled_flag
      ,fdsv.required_flag
      ,fdsv.read_only_flag
      ,fdsv.description
      ,fdsv.sequence_number
      ,fdsv.derivation_value
      ,fdsv.bi_enabled_flag
  FROM
 fnd_df_segments_vl fdsv,
       fnd_vs_value_sets fvvs
 WHERE fdsv.value_set_id = fvvs.value_set_id(+)
   AND fdsv.descriptive_flexfield_code = 'PER_ASG_DF'
Reports (BIP) – Query to get child request details

When a scheduled request is submitted, the details are stored in ess_request_history table. If the submitted request has no child requests, it will have only one row in the table.

The ParentId attribute in this case will be 0. However, if the parent request invokes multiple child jobs, the parentId attribute will have the requestid of previous request. In order to segregate the all child jobs submitted by a parent request, one need to use absParentId attribute in the table.

Below is the sample query:

SELECT REQUESTID,APPLICATION,NAME,ABSPARENTID,PARENTREQUESTID,INSTANCEPARENTID
  FROM ess_request_history
 WHERE ABSPARENTID = 2394562 --parent request id
 ORDER BY requestid DESC
Reports (BIP) – Query to get Assignee details for a course
SELECT warf.ASSIGNMENT_RECORD_ID,
warf.EVENT_TYPE,
we.EVENT_TYPE we_event_type,
warf.EVENT_SUB_TYPE,
we.EVENT_SUB_TYPE we_EVENT_SUB_TYPE,
(SELECT person_number
FROM per_all_people_f
WHERE person_id = warf.EVENT_CREATED_BY_ID
AND TRUNC(SYSDATE) BETWEEN effective_start_date AND effective_end_date) created_By,
we.CREATED_BY_ID "Assigned_By_Person_Id",
(SELECT person_number
FROM per_all_people_f
WHERE person_id = we.CREATED_BY_ID
AND TRUNC(SYSDATE) BETWEEN effective_start_date AND effective_end_date) "Assigned_By",
warf.ATTRIBUTION_TYPE,
we.ATTRIBUTION_TYPE we_ATTRIBUTION_TYPE,
(SELECT person_number
FROM per_all_people_f
WHERE person_id = warf.ATTRIBUTION_ID
AND TRUNC(SYSDATE) BETWEEN effective_start_date AND effective_end_date) attribution_id,
warf.ATTRIBUTION_ID warf_ATTRIBUTION_ID,
we.ATTRIBUTION_ID we_ATTRIBUTION_ID,
warf.learner_id,
warf.ATTRIBUTION_LOOKUP_CODE,
warf.EVENT_ASSIGNMENT_ID
from WLF_ASSIGNMENT_RECORDS_F warf,
WLF_EVENT_ASSIGNMENTS_F weaf,
WLF_EVENTS we
where warf.EVENT_ASSIGNMENT_ID = weaf.EVENT_ASSIGNMENT_ID
and trunc(sysdate) between warf.effective_start_date and warf.effective_end_date
and trunc(sysdate) between weaf.effective_start_date and weaf.effective_end_date
and we.event_id = weaf.event_id
Reports (BIP) – Query to extract default Access Group data for a Course/Offering

In Oracle Learning cloud, Learning Admin can define the Default access at Course or offering level. Course.dat can be used to load this information.

In order to extract this information from DB in HDL format, please use below query:

SELECT 'MERGE' 	                                           "METADATA"       
      ,'CourseDefaultAccess' 		                   "CourseDefaultAccess"                  
      ,to_char(wapf.effective_start_date,'RRRR/MM/DD')     "EffectiveStartDate"           
      ,to_char(wapf.effective_end_date,'RRRR/MM/DD')       "EffectiveEndDate"       
      ,wapf.access_permission_number                       "DefaultAccessNumber"       
      ,wlif.learning_item_number                           "CourseNumber"       
      ,wapf.follow_spec 	                           "FollowSpecialization"       
      ,wapf.assign_as_manager                		   "MgrInitialStatus"       
      ,wapf.assign_for_self                                "SelfInitialStatus"        
      ,wlif.ss_view_mode                                   "SelfViewMode"    
 FROM WLF_ACCESS_PERMISSIONS_F wapf      
     ,WLF_LEARNING_ITEMS_F wlif 
WHERE 1=1   
  AND wapf.access_permission_id= wlif.access_permission_id   
--AND trunc(sysdate) between wapf.effective_start_date and wapf.effective_end_date   
  AND trunc(sysdate) between wlif.effective_start_date and wlif.effective_end_date   
  AND wlif.learning_item_number = 'OLC251051'

Also, learners can be assigned using Access Groups.

To extract this information below SQL can be used:

SELECT wlif.learning_item_id
      ,wlif.learning_item_number course_Number
      ,wlif_tl.name course_Name
      ,wlif_tl.description_short description
      ,wlif_ag.learning_item_number access_group_number
      ,wlif_tl_ag.name access_group_name
  FROM wlf_learning_items_f 	wlif
      ,wlf_learning_items_f_tl 	wlif_tl
      ,wlf_learning_items_f 	wlif_ag
      ,wlf_learning_items_f_tl 	wlif_tl_ag
      ,wlf_li_ag_relations_f 	wlarf
 WHERE 1=1
   AND wlif_tl.learning_item_id 		= wlif.learning_item_id
   AND wlif_tl.name 				= 'Test 1234'
   AND wlif_ag.learning_item_type 		= 'ORA_ACCESS_GROUP'
   AND wlif_tl_ag.learning_item_id 		= wlif_ag.learning_item_id
   AND wlarf.access_learning_item_id 	= wlif_ag.learning_item_id
   AND wlarf.catalog_learning_item_id 	= wlif.learning_item_id   
   AND TRUNC(SYSDATE) BETWEEN wlif_tl_ag.effective_start_date AND wlif_tl_ag.effective_end_date
   AND TRUNC(SYSDATE) BETWEEN wlif_ag.effective_start_date AND wlif_ag.effective_end_date
   AND TRUNC(SYSDATE) BETWEEN wlif_tl.effective_start_date AND wlif_tl.effective_end_date
   AND TRUNC(SYSDATE) BETWEEN wlif.effective_start_date AND wlif.effective_end_date
Reports (BIP) – Query to get correct time zone

When an activity in learning is created with a start time and end time, the time is stored in UTC format in the data base. When any reporting is done on this data, the output is incorrect as time is shown in UTC format which is different from user time format.

This is applicable for all transactions. Please use the below workaorund to get the correct date time in the SQL:

select wlif.start_date
      ,wlaf.time_zone
      ,TZ_OFFSET(wlaf.time_zone) time_zone_offset
      ,(FROM_TZ(CAST(wlif.start_date AS TIMESTAMP),(case when TZ_OFFSET(wlaf.time_zone)     like '+%'
then '-'||substr(TZ_OFFSET(wlaf.time_zone),2)
else '+'||substr(TZ_OFFSET(wlaf.time_zone),2)
end
))) actual_start_date
      ,TO_CHAR(CAST(wlif.start_date AT TIME ZONE wlaf.time_zone AS DATE),'HH:Mi AM','nls_date_language=American') actual_start_time
 from wlf_learning_items_f wlif
    , wlf_li_activities_f wlaf
where learning_item_number= 'OLC245017'
  and wlif.learning_item_id = wlaf.learning_item_id
  and trunc(sysdate) between wlif.effective_start_date and wlif.effective_end_date
  and trunc(sysdate) between wlaf.effective_start_date and wlaf.effective_end_date
HDL – Query to get Assignment Grade Steps
SELECT 'MERGE' "METADATA"
      ,'AssignmentGradeSteps' "AssignmentGradeSteps"
      ,pagsf.EFFECTIVE_START_DATE "EffectiveStartDate"
      ,pagsf.EFFECTIVE_END_DATE "EffectiveEndDate"
      ,pagsf.ASSIGN_GRADE_STEP_ID "AssignGradeStepId"
      ,paam.assignment_number "AssignmentNumber"
      ,pav.ACTION_CODE "ActionCode"
      ,parv.ACTION_REASON_CODE "ReasonCode"
      ,pgsfv.name "GradeStepName"
      ,NULL "NewGradeStepName" --> to be supplied
 FROM PER_ASSIGN_GRADE_STEPS_F pagsf,
      PER_GRADE_STEPS_F_VL pgsfv,
      PER_ALL_ASSIGNMENTS_M paam,
      PER_ACTION_OCCURRENCES pao,
      PER_ACTIONS_VL pav,
      PER_ACTION_REASONS_VL parv
WHERE pagsf.GRADE_STEP_ID = pgsfv.GRADE_STEP_ID
  AND TRUNC(SYSDATE) BETWEEN pagsf.effective_start_date AND pagsf.effective_end_date
  AND TRUNC(SYSDATE) BETWEEN pgsfv.effective_start_date AND pgsfv.effective_end_date
  AND TRUNC(SYSDATE) BETWEEN paam.effective_start_date AND paam.effective_end_date
  AND pagsf.assignment_id = paam.assignment_id
  AND paam.assignment_type = 'E'
  AND paam.effective_latest_change = 'Y'
  AND pagsf.ACTION_OCCURRENCE_ID = pao.ACTION_OCCURRENCE_ID
  AND pav.action_id = pao.action_id
  AND parv.action_reason_id = pao.action_reason_id
ORC – Query to get candidate application status
select distinct ic.candidate_number,
ppnfv.full_name,
irv.requisition_number,
ipv.name as phase,
isv.name as state
from irc_requisitions_vl irv,
irc_submissions isub,
irc_phases_vl ipv,
irc_states_vl isv,
per_person_names_f_v ppnfv,
irc_candidates ic
where 1=1
AND irv.REQUISITION_ID (+) = isub.REQUISITION_ID
AND ipv.PHASE_ID (+) = isub.CURRENT_PHASE_ID
AND isv.STATE_ID (+) = isub.CURRENT_STATE_ID
AND isub.PERSON_ID (+) = ic.PERSON_ID
AND ic.PERSON_ID = ppnfv.PERSON_ID
AND ppnfv.NAME_TYPE = 'GLOBAL'
AND TRUNC(SYSDATE) BETWEEN ppnfv.EFFECTIVE_START_DATE AND ppnfv.EFFECTIVE_END_DATE
ORDER BY ic.candidate_number
Reports (BIP) – Query to extract basic position details
SELECT
to_char(hapf.Effective_Start_Date,'YYYY/MM/DD') "Effective_Start_Date",
to_char(hapf.Effective_End_Date,'YYYY/MM/DD') "Effective_End_Date",
(SELECT DISTINCT BU_NAME from FUN_ALL_BUSINESS_UNITS_V fun where fun.BU_ID= BUSINESS_UNIT_ID) "BU",
(select DISTINCT hapft.NAME
from HR_ALL_POSITIONS_F_TL hapft
where hapft.position_id=hapf.position_id
AND trunc(sysdate) between trunc(hapft.effective_start_date) and trunc(hapft.effective_end_date)
AND hapft.language = USERENV('LANG')
) "Pos_Name",
hapf.POSITION_CODE "PosCode",
hapf.ACTIVE_STATUS "Active_Inactive",
(select DISTINCT horg.NAME from HR_ALL_ORGANIZATION_UNITS_F_VL horg where horg.ORGANIZATION_ID=hapf.ORGANIZATION_ID
AND trunc(sysdate) between trunc(horg.effective_start_date) and trunc(horg.effective_end_date)) "Dept",
(select pjft.name
from per_jobs_f_tl pjft
WHERE pjft.job_id = hapf.job_id
AND trunc(SYSDATE) BETWEEN pjft.effective_start_date AND pjft.effective_end_date
AND language = USERENV('LANG')) "Job",
(select pj.job_code from per_jobs pj where pj.job_id=hapf.job_id
AND trunc(sysdate) between trunc(pj.effective_start_date) and trunc(pj.effective_end_date)) "JobCode",
(select hlaf.location_code from hr_locations_all_f_vl HLAF where HLAF.location_id=hapf.location_id
AND trunc(sysdate) between trunc(HLAF.effective_start_date) and trunc(HLAF.effective_end_date)
) "Location"
FROM HR_ALL_POSITIONS_F hapf
where TRUNC(SYSDATE) between trunc(hapf.effective_start_date) and trunc(hapf.effective_end_date)
Reports (BIP) – Query to extract Manage Person Name Styles

Manage Person Name Styles is a task that can be used to configure additional Name attributes for a country if required.

Also, a name component can be made required as per requirement.

In multi country implementations, it is required to know the setup for technical developers as it is hard to check the setup for each country from the UI. In such cases, below SQL can be used to extract the information from backend tables:

SELECT pnsv.legislation_code
      ,pensv.display_sequence
      ,pensv.column_name
      ,pensv.prompt
      ,pensv.required_flag
  FROM PER_EDIT_NAME_SETUP_VL pensv,
       PER_NAME_STYLES_VL pnsv
WHERE pensv.name_style_id = pnsv.name_style_id
ORDER BY 1,2