Oracle Fusion SaaS provides a very powerful feature of Custom Objects. The feature allows creation of fields, triggers, actions and pages by using the Application Composer.
Every Custom Objects has its own API name allowing performing CRUD operations on its records.
When a new Custom Object is created, the system decides which extension table will be used and will map logical names of fields to specific columns in an extension table. The mapping of table and columns may change if fields are deleted and created again even if they have same API name of the field.
Oracle Fusion SaaS allows writing direct SQL queries against the fusion database (ESS Job parameter sources, Flexfield value Sets, BIP Reports) and if the mapping changes – those queries should be updated.
The solution is based on the following abilities:
SELECT OBJECT_ATTR_NAME AS ATRRIBUTE, TXN_VO_ATTR_TABLE tab_name, TXN_VO_ATTR_COL col_name
FROM FUSION.MKT_IMP_OBJECT_DETAILS D, FUSION.MKT_IMP_OBJECT_ATTRS A
WHERE D.OBJECT_DETAIL_ID=A.OBJECT_DETAIL_ID
AND A.OBJECT_ATTR_COL LIKE '%EXTN_ATTRIBUTE%' AND A.CREATED_BY != 'SEED_DATA_FROM_APPLICATION'
AND D.OBJECT_DETAIL_TABLE != 'MKT_IMP_JOBS'
AND OBJECT_NAME LIKE :p_object || '%'select ' || listagg(col_name || ' ' || ATRRIBUTE, ', ') || ' from ' || max(tab_name) from (<query above>)select dbms_xmlgen.getxmltype('select ' || listagg(col_name || ' ' || ATRRIBUTE, ', ') || ' from ' || max(tab_name) || ' where attribute_category = ''' || :p_object || ''' ') dt from (
SELECT OBJECT_ATTR_NAME AS ATRRIBUTE, TXN_VO_ATTR_TABLE tab_name, TXN_VO_ATTR_COL col_name
FROM FUSION.MKT_IMP_OBJECT_DETAILS D, FUSION.MKT_IMP_OBJECT_ATTRS A
WHERE D.OBJECT_DETAIL_ID=A.OBJECT_DETAIL_ID
AND A.OBJECT_ATTR_COL LIKE '%EXTN_ATTRIBUTE%' AND A.CREATED_BY != 'SEED_DATA_FROM_APPLICATION'
AND D.OBJECT_DETAIL_TABLE != 'MKT_IMP_JOBS'AND D.OBJECT_ATTR_NAME in ('Field Api Name 1', 'Field Api Name 2')
AND OBJECT_NAME LIKE :p_object || '%'
)XMLTABLE('/ROWSET/ROW'
PASSING q.dt
COLUMNS
"NAME_C" varchar2(50) PATH 'NAME_C',
"DESCRIPTION_C" varchar2(250) PATH 'DESCRIPTION_C'
)