段值相关
?
1,父值和子值常用表
fnd_flex_value_norm_hierarchy-------父值,其中有子值的范圍,
fnd_flex_value_children_v--------------可以查詢 父值下包含的所有子值。
以上兩張表都通過flex_value_set_id做定位
應用:在報表中存在一類參數情況,要求參數輸入父值的時候,返回全部子值的相應信息,此要求的實現關鍵語法如下:
-------先驗證是否是父值(fnd_flex_value_norm_hierarchy)
?select count(1)
??? into l_count
??? from fnd_flex_value_norm_hierarchy ffh,
???????? fnd_id_flex_segments????????? ffs,
???????? gl_sets_of_books????????????? gb
??? where ffh.flex_value_set_id = ffs.flex_value_set_id
??? and gb.short_name = 'PROPERTY_SOB'----------------賬簿簡稱
??? and ffs.application_id = 101
??? and ffs.id_flex_code = 'GL#'
??? and ffs.id_flex_num = gb.chart_of_accounts_id
??? and ffs.application_column_name = 'SEGMENT1'--------公司段可以換為其他段
??? and ffh.parent_flex_value = g_company;-------------參數
?
??? if l_count > 0-----------------------------------------說明是父值
??? then
?
????????? SELECT gb.name,ffh.flex_value_set_id, ffh.parent_flex_value,ffh.child_flex_value_low, ffh.child_flex_value_high,ffc.flex_value
-----------可以找出相應的子值范圍或者父值中包含的所有子值(ffc.flex_value)
?
????? from fnd_flex_value_norm_hierarchy ffh,
?????????? fnd_id_flex_segments????????? ffs,
?????????? gl_sets_of_books????????????? gb,
?????????? fnd_flex_value_children_v? ffc
????? where ffh.flex_value_set_id = ffs.flex_value_set_id
????? AND ffc.flex_value_set_id=ffh.flex_value_set_id
????? AND ffc.parent_flex_value=ffh.parent_flex_value
?? /*?? and gb.short_name = 'PROPERTY_SOB'*/
????? and ffs.application_id = 101
????? and ffs.id_flex_code = 'GL#'
????? and ffs.id_flex_num = gb.chart_of_accounts_id
????? and ffs.application_column_name = 'SEGMENT1'
????? /*and ffh.parent_flex_value = g_company*/;
??? else
???? 直接按子值,最簡單的情況處理即可
?? ?
??? end if;
?
?2,,常用查詢段值 FLEX_VALUE_SET_ID或者FLEX_VALUE如下:
?????? select ffv.DESCRIPTION ,ffv.FLEX_VALUE_SET_ID from? fnd_flex_values_vl ffv ,fnd_id_flex_segments ffs,gl_sets_of_books gb
????? ?
?????? where ffv.FLEX_VALUE_SET_ID=ffs.FLEX_VALUE_SET_ID
?????? and gb.SHORT_NAME='PROPERTY_SOB'---------------------------賬簿簡稱
?????? and ffv.FLEX_VALUE='04'----------------------------------------具體值
?????? and ffs.APPLICATION_ID=101
?????? and ffs.ID_FLEX_CODE='GL#'
?????? and ffs.ID_FLEX_NUM= gb.CHART_OF_ACCOUNTS_ID
?????? and ffs.APPLICATION_COLUMN_NAME='SEGMENT1'; --------段
??????
?
轉載于:https://www.cnblogs.com/akami/p/6933636.html
總結
- 上一篇: docker安装问题:E: Packag
- 下一篇: 找到了一些很好的算法书和试题