Monday, March 8, 2021

Query to get data from HCM User-Defined tables

SELECT *

FROM (

SELECT R.ROW_LOW_RANGE_OR_NAME ROW_ID,

V.VALUE,

C_TL.USER_COLUMN_NAME

FROM FF_USER_TABLES T,

FF_USER_ROWS_F R,

FF_USER_COLUMNS C,

FF_USER_COLUMNS_TL C_TL,

FF_USER_COLUMN_INSTANCES_F V

WHERE T.BASE_USER_TABLE_NAME = :UDT_TABLE_NAME

AND T.USER_TABLE_ID = R.USER_TABLE_ID

AND C.USER_COLUMN_ID = C_TL.USER_COLUMN_ID

AND T.USER_TABLE_ID = C.USER_TABLE_ID

AND C.USER_COLUMN_ID = V.USER_COLUMN_ID

AND R.USER_ROW_ID = V.USER_ROW_ID

AND SYSDATE BETWEEN V.EFFECTIVE_START_DATE

AND V.EFFECTIVE_END_DATE

AND SYSDATE BETWEEN R.EFFECTIVE_START_DATE

AND R.EFFECTIVE_END_DATE

)

PIVOT(MAX(VALUE) FOR USER_COLUMN_NAME IN (

USER_COLUMN_NAME1,

USER_COLUMN_NAME2

))

No comments:

Post a Comment