BIP – Query to extract Content Items Details
SELECT 'METADATA'
,'ContentItem'
,hctb.content_type_id
,hctb.context_name
,hcibt.name
,hctvt.value_set_name
,hg.geography_name
,hcibt.item_description
,to_char(hcib.date_from,'yyyy/mm/dd')
,hg.geography_code
,hcib.content_item_code
,to_char(hcib.date_to,'yyyy/mm/dd')
,hrmb.rating_model_code
,hrmb.rating_model_id
,hikm.source_system_id
,hikm.source_system_owner
FROM HRT_CONTENT_ITEMS_B hcib
,HRT_CONTENT_ITEMS_TL hcibt
,HRT_CONTENT_TYPES_B hctb
,HZ_GEOGRAPHIES hg
,HRT_RATING_MODELS_B hrmb
,HRT_CONTENT_TP_VALUESETS_TL hctvt
,HRC_INTEGRATION_KEY_MAP hikm
where hcib.CONTENT_ITEM_ID=hcibt.CONTENT_ITEM_ID
AND hcibt.LANGUAGE=userenv('LANG')
AND hcib.CONTENT_TYPE_ID=hctb.CONTENT_TYPE_ID(+)
AND hikm.surrogate_id = hcib.CONTENT_ITEM_ID
AND hcib.COUNTRY_ID=hg.GEOGRAPHY_ID(+)
AND hg.GEOGRAPHY_TYPE(+)='COUNTRY'
AND trunc(hcib.DATE_FROM) between hg.START_DATE(+) and nvl(hg.END_DATE(+),to_date('4712/12/31','YYYY/MM/DD'))
AND hcib.RATING_MODEL_ID=hrmb.RATING_MODEL_ID(+)
AND trunc(hcib.DATE_FROM) between hrmb.DATE_FROM(+) and nvl(hrmb.DATE_TO(+),to_date('4712/12/31','YYYY/MM/DD'))
AND hcib.CONTENT_VALUE_SET_ID=hctvt.CONTENT_VALUE_SET_ID(+)
AND hctvt.LANGUAGE(+)=userenv('LANG')
AND hctb.CONTEXT_NAME = 'LANGUAGE'