Professional Documents
Culture Documents
What Is The SQL To Get Latest Database Items
What Is The SQL To Get Latest Database Items
SOLUTION
Most of the time functional and technical implementation consultants need list of
DBIs available on instance. HCM Extract development team delivers new DBIs on a
regular basis via monthly patch bundles.
Below is the SQL which can be used to get latest DBI list available on a given
instance.
select
fat.module_name, fdg.base_group_name, fdg.group_name, fdi.base_user_name,
fdi.user_name, fdi.description, fdi.data_type, fdi.definition_text,
fue.base_user_entity_name, fue.description description_1,
fr.base_route_name, fr.text, fr.multi_row_flag,
(select substr(sys.stragg(','||base_context_name),2) context
from fusion.ff_route_context_usages i, fusion.ff_contexts_vl j
where i.context_id = j.context_id
and i.route_id = fr.route_id ) contexts_used,
(select substr(sys.stragg(','||parameter_name),2) context
from fusion.ff_route_parameters
where route_id = fr.route_id) parameters,
(select substr(sys.stragg(','||base_context_name),2) context
from fusion.ff_dbi_groups_vl a, fusion.ff_dbi_usages b,
fusion.ff_database_items_vl c, fusion.ff_contexts_vl d
where a.context_id = d.context_id
and a.dbi_group_id = b.dbi_group_id
and b.dbi_id = c.database_item_id
and c.user_entity_id = fue.user_entity_id) contexts_set
from fusion.ff_database_items_vl fdi, fusion.ff_dbi_usages fdu,
fusion.ff_dbi_groups_vl fdg, fusion.fnd_appl_taxonomy_vl fat,
fusion.ff_user_entities_vl fue, fusion.ff_routes_vl fr
where fdi.module_id is not null
and fdi.database_item_id = fdu.dbi_id(+)
and fdu.dbi_group_id = fdg.dbi_group_id(+)
and fdi.module_id = fat.module_id
and fdi.user_entity_id = fue.user_entity_id
and fue.route_id = fr.route_id
and fdi.module_id is not null
order by module_name, fdi.base_user_name
The values that can be fetched with a specific DBI are stored in fdi.definition_text
and the code behind DBI is in fr.text:
select
fat.module_name, fdi.definition_text, fue.base_user_entity_name,
fr.*,fdg.base_group_name, fdg.group_name, fdi.base_user_name, fdi.user_name,
fdi.description, fdi.data_type,
fue.description, fr.base_route_name, fr.multi_row_flag,
(select substr(sys.stragg(','||base_context_name),2) context
from fusion.ff_route_context_usages i, fusion.ff_contexts_vl j
where i.context_id = j.context_id
and i.route_id = fr.route_id ) contexts_used,
(select substr(sys.stragg(','||parameter_name),2) context
from fusion.ff_route_parameters
where route_id = fr.route_id) parameters,
(select substr(sys.stragg(','||base_context_name),2) context
from fusion.ff_dbi_groups_vl a, fusion.ff_dbi_usages b, fusion.ff_database_items_vl
c, fusion.ff_contexts_vl d
where a.context_id = d.context_id
and a.dbi_group_id = b.dbi_group_id
and b.dbi_id = c.database_item_id
and c.user_entity_id = fue.user_entity_id) contexts_set
from fusion.ff_database_items_vl fdi, fusion.ff_dbi_usages fdu,
fusion.ff_dbi_groups_vl fdg, fusion.fnd_appl_taxonomy_vl fat,
fusion.ff_user_entities_vl fue, fusion.ff_routes_vl fr
where fdi.module_id is not null
and fue.base_user_entity_name like 'PER_%DISABILIT%'
and fdi.database_item_id = fdu.dbi_id(+)
and fdu.dbi_group_id = fdg.dbi_group_id(+)
and fdi.module_id = fat.module_id
and fdi.user_entity_id = fue.user_entity_id
and fue.route_id = fr.route_id
and fdi.module_id is not null
order by module_name, fdi.base_user_name
This script is used to see which dbis are available to fetch data from
per_disabilities_f record
select
distinct fue.base_user_entity_name
from fusion.ff_database_items_vl fdi, fusion.ff_dbi_usages fdu,
fusion.ff_dbi_groups_vl fdg, fusion.fnd_appl_taxonomy_vl fat,
fusion.ff_user_entities_vl fue, fusion.ff_routes_vl fr
where fdi.module_id is not null
and fue.base_user_entity_name like 'PER_%DISABILIT%'
and fdi.database_item_id = fdu.dbi_id(+)
and fdu.dbi_group_id = fdg.dbi_group_id(+)
and fdi.module_id = fat.module_id
and fdi.user_entity_id = fue.user_entity_id
and fue.route_id = fr.route_id
and fdi.module_id is not null
If you are looking by wild card, please use this sql example:
select ue.BASE_USER_ENTITY_NAME,DI.BASE_USER_NAME
from fusion.FF_USER_ENTITIES_VL UE, fusion.FF_DATABASE_ITEMS_VL DI
where UE.USER_ENTITY_ID=DI.USER_ENTITY_ID
and DI.BASE_USER_NAME like 'ºNK_ACCOUNT%'
If the expected DBI is not returned in the list, log a Service Request with Oracle
Support for further assistance.