DBA Data[Home] [Help]

VIEW: APPS.MSD_UOM_CONVERSIONS_V

Source

View Text - Preformatted

SELECT /* item specific conversion */ u.from_uom_class, u.to_uom_class, u.from_uom_code, u.to_uom_code, u.base_uom_flag, u.conversion_rate, lv.level_pk, lv.level_value, u.instance, u.last_refresh_num, u.created_by_refresh_num, u.action_code FROM msd_uom_conversions u, msd_level_values lv WHERE lv.sr_level_pk = to_char(u.sr_item_pk) and lv.level_id = 1 and lv.instance = u.instance UNION /* null sr_item_pk is okay for same class conversions */ SELECT u.from_uom_class, u.to_uom_class, u.from_uom_code, u.to_uom_code, u.base_uom_flag, u.conversion_rate, to_number(null), u.item, u.instance, u.last_refresh_num, u.created_by_refresh_num, u.action_code FROM msd_uom_conversions u WHERE u.sr_item_pk is null and u.from_uom_class = u.to_uom_class UNION /* switch from and to for the reverse conversion */ SELECT u.to_uom_class, u.from_uom_class, u.to_uom_code, u.from_uom_code, u.base_uom_flag, 1/u.conversion_rate, lv.level_pk, lv.level_value, u.instance, u.last_refresh_num, u.created_by_refresh_num, u.action_code FROM msd_uom_conversions u, msd_level_values lv WHERE lv.sr_level_pk = to_char(u.sr_item_pk) and lv.level_id = 1 and lv.instance = u.instance UNION /* reverse rates for same class conversions without an item reference */ SELECT u.to_uom_class, u.from_uom_class, u.to_uom_code, u.from_uom_code, u.base_uom_flag, 1/u.conversion_rate, to_number(null), u.item, u.instance, u.last_refresh_num, u.created_by_refresh_num, u.action_code FROM msd_uom_conversions u WHERE u.sr_item_pk is null and u.from_uom_class = u.to_uom_class
View Text - HTML Formatted

SELECT /* ITEM SPECIFIC CONVERSION */ U.FROM_UOM_CLASS
, U.TO_UOM_CLASS
, U.FROM_UOM_CODE
, U.TO_UOM_CODE
, U.BASE_UOM_FLAG
, U.CONVERSION_RATE
, LV.LEVEL_PK
, LV.LEVEL_VALUE
, U.INSTANCE
, U.LAST_REFRESH_NUM
, U.CREATED_BY_REFRESH_NUM
, U.ACTION_CODE
FROM MSD_UOM_CONVERSIONS U
, MSD_LEVEL_VALUES LV
WHERE LV.SR_LEVEL_PK = TO_CHAR(U.SR_ITEM_PK)
AND LV.LEVEL_ID = 1
AND LV.INSTANCE = U.INSTANCE UNION /* NULL SR_ITEM_PK IS OKAY FOR SAME CLASS CONVERSIONS */ SELECT U.FROM_UOM_CLASS
, U.TO_UOM_CLASS
, U.FROM_UOM_CODE
, U.TO_UOM_CODE
, U.BASE_UOM_FLAG
, U.CONVERSION_RATE
, TO_NUMBER(NULL)
, U.ITEM
, U.INSTANCE
, U.LAST_REFRESH_NUM
, U.CREATED_BY_REFRESH_NUM
, U.ACTION_CODE
FROM MSD_UOM_CONVERSIONS U
WHERE U.SR_ITEM_PK IS NULL
AND U.FROM_UOM_CLASS = U.TO_UOM_CLASS UNION /* SWITCH
FROM AND TO FOR THE REVERSE CONVERSION */ SELECT U.TO_UOM_CLASS
, U.FROM_UOM_CLASS
, U.TO_UOM_CODE
, U.FROM_UOM_CODE
, U.BASE_UOM_FLAG
, 1/U.CONVERSION_RATE
, LV.LEVEL_PK
, LV.LEVEL_VALUE
, U.INSTANCE
, U.LAST_REFRESH_NUM
, U.CREATED_BY_REFRESH_NUM
, U.ACTION_CODE
FROM MSD_UOM_CONVERSIONS U
, MSD_LEVEL_VALUES LV
WHERE LV.SR_LEVEL_PK = TO_CHAR(U.SR_ITEM_PK)
AND LV.LEVEL_ID = 1
AND LV.INSTANCE = U.INSTANCE UNION /* REVERSE RATES FOR SAME CLASS CONVERSIONS WITHOUT AN ITEM REFERENCE */ SELECT U.TO_UOM_CLASS
, U.FROM_UOM_CLASS
, U.TO_UOM_CODE
, U.FROM_UOM_CODE
, U.BASE_UOM_FLAG
, 1/U.CONVERSION_RATE
, TO_NUMBER(NULL)
, U.ITEM
, U.INSTANCE
, U.LAST_REFRESH_NUM
, U.CREATED_BY_REFRESH_NUM
, U.ACTION_CODE
FROM MSD_UOM_CONVERSIONS U
WHERE U.SR_ITEM_PK IS NULL
AND U.FROM_UOM_CLASS = U.TO_UOM_CLASS