DBA Data[Home] [Help]

VIEW: APPS.OTA_CATEGORY_USAGES_V

Source

View Text - Preformatted

SELECT tcuc.business_group_id ,tcuc.category ,lk1.meaning ,'Y' ,tcuc.category_usage_id ,tcuc.rowid ,tcuc.object_version_number ,'Y' ,tcup.category_usage_id ,tcup.rowid ,tcup.object_version_number ,'Y' ,tcud.category_usage_id ,tcud.rowid ,tcud.object_version_number from ota_category_usages tcuc , ota_category_usages tcup , ota_category_usages tcud , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcuc.category = lk1.lookup_code and tcuc.type = 'C' and tcup.category = lk1.lookup_code and tcup.type = 'P' and tcud.category = lk1.lookup_code and tcud.type = 'D' and tcuc.business_group_id = tcup.business_group_id and tcup.business_group_id = tcud.business_group_id union select tcuc.business_group_id ,tcuc.category ,lk1.meaning ,'Y' ,tcuc.category_usage_id ,tcuc.rowid ,tcuc.object_version_number ,'Y' ,tcup.category_usage_id ,tcup.rowid ,tcup.object_version_number ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) from ota_category_usages tcuc , ota_category_usages tcup , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcuc.category = lk1.lookup_code and tcuc.type = 'C' and tcup.category = lk1.lookup_code and tcup.type = 'P' and tcuc.business_group_id = tcup.business_group_id and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'D' and tcu.business_group_id = tcuc.business_group_id) union select tcup.business_group_id ,tcup.category ,lk1.meaning ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'Y' ,tcup.category_usage_id ,tcup.rowid ,tcup.object_version_number ,'Y' ,tcud.category_usage_id ,tcud.rowid ,tcud.object_version_number from ota_category_usages tcud , ota_category_usages tcup , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcud.category = lk1.lookup_code and tcud.type = 'D' and tcup.category = lk1.lookup_code and tcup.type = 'P' and tcud.business_group_id = tcup.business_group_id and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'C' and tcu.business_group_id = tcup.business_group_id) union select tcuc.business_group_id ,tcuc.category ,lk1.meaning ,'Y' ,tcuc.category_usage_id ,tcuc.rowid ,tcuc.object_version_number ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'Y' ,tcud.category_usage_id ,tcud.rowid ,tcud.object_version_number from ota_category_usages tcuc , ota_category_usages tcud , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcuc.category = lk1.lookup_code and tcuc.type = 'C' and tcud.category = lk1.lookup_code and tcud.type = 'D' and tcuc.business_group_id = tcud.business_group_id and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'P' and tcu.business_group_id = tcuc.business_group_id) union select tcuc.business_group_id ,tcuc.category ,lk1.meaning ,'Y' ,tcuc.category_usage_id ,tcuc.rowid ,tcuc.object_version_number ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) from ota_category_usages tcuc , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcuc.category = lk1.lookup_code and tcuc.type = 'C' and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'P' and tcu.business_group_id = tcuc.business_group_id) and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'D' and tcu.business_group_id = tcuc.business_group_id) union select tcup.business_group_id ,tcup.category ,lk1.meaning ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'Y' ,tcup.category_usage_id ,tcup.rowid ,tcup.object_version_number ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) from ota_category_usages tcup , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcup.category = lk1.lookup_code and tcup.type = 'P' and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'C' and tcu.business_group_id = tcup.business_group_id) and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'D' and tcu.business_group_id = tcup.business_group_id) union select tcud.business_group_id ,tcud.category ,lk1.meaning ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'N' ,to_number(null) ,chartorowid(null) ,to_number(null) ,'Y' ,tcud.category_usage_id ,tcud.rowid ,tcud.object_version_number from ota_category_usages tcud , hr_lookups lk1 where lk1.lookup_type = 'ACTIVITY_CATEGORY' and tcud.category = lk1.lookup_code and tcud.type = 'D' and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'C' and tcu.business_group_id = tcud.business_group_id) and not exists (select null from ota_category_usages tcu where tcu.category = lk1.lookup_code and tcu.type = 'P' and tcu.business_group_id = tcud.business_group_id)
View Text - HTML Formatted

SELECT TCUC.BUSINESS_GROUP_ID
, TCUC.CATEGORY
, LK1.MEANING
, 'Y'
, TCUC.CATEGORY_USAGE_ID
, TCUC.ROWID
, TCUC.OBJECT_VERSION_NUMBER
, 'Y'
, TCUP.CATEGORY_USAGE_ID
, TCUP.ROWID
, TCUP.OBJECT_VERSION_NUMBER
, 'Y'
, TCUD.CATEGORY_USAGE_ID
, TCUD.ROWID
, TCUD.OBJECT_VERSION_NUMBER
FROM OTA_CATEGORY_USAGES TCUC
, OTA_CATEGORY_USAGES TCUP
, OTA_CATEGORY_USAGES TCUD
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUC.CATEGORY = LK1.LOOKUP_CODE
AND TCUC.TYPE = 'C'
AND TCUP.CATEGORY = LK1.LOOKUP_CODE
AND TCUP.TYPE = 'P'
AND TCUD.CATEGORY = LK1.LOOKUP_CODE
AND TCUD.TYPE = 'D'
AND TCUC.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID
AND TCUP.BUSINESS_GROUP_ID = TCUD.BUSINESS_GROUP_ID UNION SELECT TCUC.BUSINESS_GROUP_ID
, TCUC.CATEGORY
, LK1.MEANING
, 'Y'
, TCUC.CATEGORY_USAGE_ID
, TCUC.ROWID
, TCUC.OBJECT_VERSION_NUMBER
, 'Y'
, TCUP.CATEGORY_USAGE_ID
, TCUP.ROWID
, TCUP.OBJECT_VERSION_NUMBER
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
FROM OTA_CATEGORY_USAGES TCUC
, OTA_CATEGORY_USAGES TCUP
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUC.CATEGORY = LK1.LOOKUP_CODE
AND TCUC.TYPE = 'C'
AND TCUP.CATEGORY = LK1.LOOKUP_CODE
AND TCUP.TYPE = 'P'
AND TCUC.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'D'
AND TCU.BUSINESS_GROUP_ID = TCUC.BUSINESS_GROUP_ID) UNION SELECT TCUP.BUSINESS_GROUP_ID
, TCUP.CATEGORY
, LK1.MEANING
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'Y'
, TCUP.CATEGORY_USAGE_ID
, TCUP.ROWID
, TCUP.OBJECT_VERSION_NUMBER
, 'Y'
, TCUD.CATEGORY_USAGE_ID
, TCUD.ROWID
, TCUD.OBJECT_VERSION_NUMBER
FROM OTA_CATEGORY_USAGES TCUD
, OTA_CATEGORY_USAGES TCUP
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUD.CATEGORY = LK1.LOOKUP_CODE
AND TCUD.TYPE = 'D'
AND TCUP.CATEGORY = LK1.LOOKUP_CODE
AND TCUP.TYPE = 'P'
AND TCUD.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'C'
AND TCU.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID) UNION SELECT TCUC.BUSINESS_GROUP_ID
, TCUC.CATEGORY
, LK1.MEANING
, 'Y'
, TCUC.CATEGORY_USAGE_ID
, TCUC.ROWID
, TCUC.OBJECT_VERSION_NUMBER
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'Y'
, TCUD.CATEGORY_USAGE_ID
, TCUD.ROWID
, TCUD.OBJECT_VERSION_NUMBER
FROM OTA_CATEGORY_USAGES TCUC
, OTA_CATEGORY_USAGES TCUD
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUC.CATEGORY = LK1.LOOKUP_CODE
AND TCUC.TYPE = 'C'
AND TCUD.CATEGORY = LK1.LOOKUP_CODE
AND TCUD.TYPE = 'D'
AND TCUC.BUSINESS_GROUP_ID = TCUD.BUSINESS_GROUP_ID
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'P'
AND TCU.BUSINESS_GROUP_ID = TCUC.BUSINESS_GROUP_ID) UNION SELECT TCUC.BUSINESS_GROUP_ID
, TCUC.CATEGORY
, LK1.MEANING
, 'Y'
, TCUC.CATEGORY_USAGE_ID
, TCUC.ROWID
, TCUC.OBJECT_VERSION_NUMBER
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
FROM OTA_CATEGORY_USAGES TCUC
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUC.CATEGORY = LK1.LOOKUP_CODE
AND TCUC.TYPE = 'C'
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'P'
AND TCU.BUSINESS_GROUP_ID = TCUC.BUSINESS_GROUP_ID)
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'D'
AND TCU.BUSINESS_GROUP_ID = TCUC.BUSINESS_GROUP_ID) UNION SELECT TCUP.BUSINESS_GROUP_ID
, TCUP.CATEGORY
, LK1.MEANING
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'Y'
, TCUP.CATEGORY_USAGE_ID
, TCUP.ROWID
, TCUP.OBJECT_VERSION_NUMBER
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
FROM OTA_CATEGORY_USAGES TCUP
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUP.CATEGORY = LK1.LOOKUP_CODE
AND TCUP.TYPE = 'P'
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'C'
AND TCU.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID)
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'D'
AND TCU.BUSINESS_GROUP_ID = TCUP.BUSINESS_GROUP_ID) UNION SELECT TCUD.BUSINESS_GROUP_ID
, TCUD.CATEGORY
, LK1.MEANING
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'N'
, TO_NUMBER(NULL)
, CHARTOROWID(NULL)
, TO_NUMBER(NULL)
, 'Y'
, TCUD.CATEGORY_USAGE_ID
, TCUD.ROWID
, TCUD.OBJECT_VERSION_NUMBER
FROM OTA_CATEGORY_USAGES TCUD
, HR_LOOKUPS LK1
WHERE LK1.LOOKUP_TYPE = 'ACTIVITY_CATEGORY'
AND TCUD.CATEGORY = LK1.LOOKUP_CODE
AND TCUD.TYPE = 'D'
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'C'
AND TCU.BUSINESS_GROUP_ID = TCUD.BUSINESS_GROUP_ID)
AND NOT EXISTS (SELECT NULL
FROM OTA_CATEGORY_USAGES TCU
WHERE TCU.CATEGORY = LK1.LOOKUP_CODE
AND TCU.TYPE = 'P'
AND TCU.BUSINESS_GROUP_ID = TCUD.BUSINESS_GROUP_ID)