SELECT ffvc.PARENT_FLEX_VALUE parent_value,
ffvv.DESCRIPTION Parent,
ffvc.FLEX_VALUE first_child_value,
ffvc.DESCRIPTION First_Child,
-- ffvv2.attribute1 USER_GROUP_first_child,
--ffvv.HIERARCHY_LEVEL,
child_level.FLEX_VALUE second_child_value,
child_level.second_child,
-- child_level.USER_GROUP_second_child,
--child_level.HIERARCHY_LEVEL,
child_level2.FLEX_VALUE third_child_value,
child_level2.third_child,
-- child_level2.USER_GROUP_third_child,
child_level3.FLEX_VALUE fourth_child_value,
child_level3.fourth_child,
-- child_level3.USER_GROUP_Fourth_child
child_level4.FLEX_VALUE fifth_child_value,
child_level4.fifth_child
-- child_level3.USER_GROUP_fifth_child
--child_level2.HIERARCHY_LEVEL
FROM FND_FLEX_VALUES_VL ffvv,
FND_FLEX_VALUE_CHILDREN_V ffvc,
FND_FLEX_VALUES_VL ffvv2,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION second_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_second_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID
) child_level,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION third_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_third_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level2,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION fourth_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_Fourth_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level3,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION fifth_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_fifth_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level4
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
AND child_level.PARENT_FLEX_VALUE(+) = ffvc.FLEX_VALUE
AND child_level2.PARENT_FLEX_VALUE(+) = child_level.FLEX_VALUE
AND child_level3.PARENT_FLEX_VALUE(+) = child_level2.FLEX_VALUE
AND child_level4.PARENT_FLEX_VALUE(+) = child_level3.FLEX_VALUE
AND ffvv.END_DATE_ACTIVE is null
AND ffvv.FLEX_VALUE in (select FLEX_VALUE from FND_FLEX_VALUES_VL
where FLEX_VALUE_SET_ID = 1016191
and HIERARCHY_LEVEL = 1
and ENABLED_FLAG = 'Y'
) order by ffvc.PARENT_FLEX_VALUE, ffvc.FLEX_VALUE,child_level.FLEX_VALUE,child_level2.FLEX_VALUE,
child_level3.FLEX_VALUE,child_level4.FLEX_VALUE
ffvv.DESCRIPTION Parent,
ffvc.FLEX_VALUE first_child_value,
ffvc.DESCRIPTION First_Child,
-- ffvv2.attribute1 USER_GROUP_first_child,
--ffvv.HIERARCHY_LEVEL,
child_level.FLEX_VALUE second_child_value,
child_level.second_child,
-- child_level.USER_GROUP_second_child,
--child_level.HIERARCHY_LEVEL,
child_level2.FLEX_VALUE third_child_value,
child_level2.third_child,
-- child_level2.USER_GROUP_third_child,
child_level3.FLEX_VALUE fourth_child_value,
child_level3.fourth_child,
-- child_level3.USER_GROUP_Fourth_child
child_level4.FLEX_VALUE fifth_child_value,
child_level4.fifth_child
-- child_level3.USER_GROUP_fifth_child
--child_level2.HIERARCHY_LEVEL
FROM FND_FLEX_VALUES_VL ffvv,
FND_FLEX_VALUE_CHILDREN_V ffvc,
FND_FLEX_VALUES_VL ffvv2,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION second_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_second_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID
) child_level,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION third_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_third_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level2,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION fourth_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_Fourth_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level3,
(SELECT ffvc.PARENT_FLEX_VALUE,
ffvc.FLEX_VALUE,
ffvc.DESCRIPTION fifth_child,
ffvv.HIERARCHY_LEVEL,
ffvv2.attribute1 USER_GROUP_fifth_child
FROM FND_FLEX_VALUES_VL ffvv, FND_FLEX_VALUE_CHILDREN_V ffvc,FND_FLEX_VALUES_VL ffvv2
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
) child_level4
WHERE ffvc.PARENT_FLEX_VALUE = ffvv.FLEX_VALUE
AND ffvc.FLEX_VALUE_SET_ID = ffvv.flex_value_set_id
and ffvv2.FLEX_VALUE = ffvc.FLEX_VALUE
and ffvc.flex_value_set_id = ffvv2.flex_value_set_id
AND ffvv.flex_value_set_id = 1016191--:P_VALUE_SET_ID:P_VALUE_SET_ID
AND child_level.PARENT_FLEX_VALUE(+) = ffvc.FLEX_VALUE
AND child_level2.PARENT_FLEX_VALUE(+) = child_level.FLEX_VALUE
AND child_level3.PARENT_FLEX_VALUE(+) = child_level2.FLEX_VALUE
AND child_level4.PARENT_FLEX_VALUE(+) = child_level3.FLEX_VALUE
AND ffvv.END_DATE_ACTIVE is null
AND ffvv.FLEX_VALUE in (select FLEX_VALUE from FND_FLEX_VALUES_VL
where FLEX_VALUE_SET_ID = 1016191
and HIERARCHY_LEVEL = 1
and ENABLED_FLAG = 'Y'
) order by ffvc.PARENT_FLEX_VALUE, ffvc.FLEX_VALUE,child_level.FLEX_VALUE,child_level2.FLEX_VALUE,
child_level3.FLEX_VALUE,child_level4.FLEX_VALUE
No comments:
Post a Comment