DBA Data[Home] [Help]

VIEW: APPS.BIS_REGIONS_V

Source

View Text - Preformatted

SELECT DISTINCT DECODE(c.area_code||c.country_code, NULL, btr.territory_code, c.country_code, c.country_code||'+'||btr.territory_code, c.area_code, c.area_code||'+'||btr.territory_code, c.area_code||'+'||c.country_code||'+'||btr.territory_code) ID , btr.name VALUE , btr.territory_code REGION_CODE , btr.name NAME , btr.description DESCRIPTION , c.country_code COUNTRY_CODE , c.area_code AREA_CODE from bis_territory_hierarchies_v th , bis_countries_v c , bis_territories_v btr WHERE btr.type ='REGION' and btr.territory_code = th.child_TERRITORY_code(+) and c.country_code(+) = th.parent_TERRITORY_code
View Text - HTML Formatted

SELECT DISTINCT DECODE(C.AREA_CODE||C.COUNTRY_CODE
, NULL
, BTR.TERRITORY_CODE
, C.COUNTRY_CODE
, C.COUNTRY_CODE||'+'||BTR.TERRITORY_CODE
, C.AREA_CODE
, C.AREA_CODE||'+'||BTR.TERRITORY_CODE
, C.AREA_CODE||'+'||C.COUNTRY_CODE||'+'||BTR.TERRITORY_CODE) ID
, BTR.NAME VALUE
, BTR.TERRITORY_CODE REGION_CODE
, BTR.NAME NAME
, BTR.DESCRIPTION DESCRIPTION
, C.COUNTRY_CODE COUNTRY_CODE
, C.AREA_CODE AREA_CODE
FROM BIS_TERRITORY_HIERARCHIES_V TH
, BIS_COUNTRIES_V C
, BIS_TERRITORIES_V BTR
WHERE BTR.TYPE ='REGION'
AND BTR.TERRITORY_CODE = TH.CHILD_TERRITORY_CODE(+)
AND C.COUNTRY_CODE(+) = TH.PARENT_TERRITORY_CODE