Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Fast Formula Queries for Functions, Contexts, DBIs and Packages

Below are the SQL's to extract fast formula related data from underlying tables:

Fast Formula Functions and their underlying Packages:


select f.BASE_FUNCTION_NAME, f.description, f.definition ||'(' ||
listagg(fp.name||' '||decode(fp.class,'I','IN','O','OUT')||'
'||decode(fp.data_type,'N','NUMBER','T','VARCHAR2','D','DATE'),',') WITHIN GROUP (ORDER BY
fp.sequence_number)
||') RETURN '||decode(f.data_type,'N','NUMBER','T','VARCHAR2','D','DATE') AS functionCall
from ff_function_parameters fp
, FF_FUNCTIONS_VL f
where f.function_id = fp.function_id
and upper(f.description) not like '%DEPRECATED%'

group by f.BASE_FUNCTION_NAME,f.description, f.definition,f.data_type

Fast Formula's List with FF Code:


select TO_CHAR("FF_FORMULAS_VL"."EFFECTIVE_START_DATE",'DD-MON-YYYY') as
"EFFECTIVE_START_DATE",
TO_CHAR("FF_FORMULAS_VL"."EFFECTIVE_END_DATE",'DD-MON-YYYY') as "EFFECTIVE_END_DATE",
"FF_FORMULAS_VL"."BASE_FORMULA_NAME" as "BASE_FORMULA_NAME",
"FF_FORMULAS_VL"."FORMULA_NAME" as "FORMULA_NAME",
"FF_FORMULAS_VL"."DESCRIPTION" as "DESCRIPTION",
"FF_FORMULAS_VL"."EDIT_STATUS" as "EDIT_STATUS",
"FF_FORMULAS_VL"."FORMULA_TEXT" as "FORMULA_TEXT",
"FF_FORMULAS_VL"."COMPILE_FLAG" as "COMPILE_FLAG",
"FF_FORMULAS_VL"."LEGISLATION_CODE" as "LEGISLATION_CODE",
TO_CHAR("FF_FORMULAS_VL"."LAST_UPDATE_DATE",'DD-MON-YYYY') as "LAST_UPDATE_DATE",
"FF_FORMULAS_VL"."LAST_UPDATED_BY" as "LAST_UPDATED_BY",
"FF_FORMULAS_VL"."CREATED_BY" as "CREATED_BY",
TO_CHAR("FF_FORMULAS_VL"."CREATION_DATE",'DD-MON-YYYY') as "CREATION_DATE",
"FF_FORMULA_TYPES_TL"."FORMULA_TYPE_NAME" as "FORMULA_TYPE_NAME"
from "FUSION"."FF_FORMULA_TYPES_TL" "FF_FORMULA_TYPES_TL",
"FUSION"."FF_FORMULAS_VL" "FF_FORMULAS_VL"
where "FF_FORMULAS_VL"."FORMULA_TYPE_ID"="FF_FORMULA_TYPES_TL"."FORMULA_TYPE_ID"

Extracting DBIs from a POD:


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 fue_des, 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 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

Fast Formula Contexts by Formula Type:


select t.base_formula_type_name
, ttl.formula_type_name
, ttl.description
, c.base_context_name
from ff_formula_types_b t
, ff_formula_types_tl ttl
, ff_ftype_context_usages u
, ff_contexts_b c
where t.formula_type_id = u.formula_type_id
and ttl.formula_type_id = t.formula_type_id
and ttl.language = userenv('LANG')
/*and ttl.formula_type_name like 'Oracle%Payroll%'*/

and c.context_id = u.context_id

Hope these queries help.

Stay tuned for more updates.

You might also like