值集結構,層次結構

SELECT ffvs.flex_value_set_name
      ,ffvs.description
      ,ffvv.flex_value
      ,ffvv.description
      ,ffvv.start_date_active
      ,ffvv.end_date_active
      ,decode(ffvv.enabled_flag
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') enabled_flag
      ,decode(ffvv.summary_flag
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') summary_flag
      ,ffh.hierarchy_code
      ,decode(substr(to_char(ffvv.compiled_value_attributes)
                    ,1
                    ,1)
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') budget
      ,decode(substr(to_char(ffvv.compiled_value_attributes)
                    ,3
                    ,1)
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') post
      ,decode(substr(to_char(ffvv.compiled_value_attributes)
                    ,5
                    ,1)
             ,'A'
             ,'資產'
             ,'E'
             ,'費用'
             ,'L'
             ,'負債'
             ,'R'
             ,'收入'
             ,'O'
             ,'所有權/股東的權益'
             ,'') TYPE
      ,decode(substr(to_char(ffvv.compiled_value_attributes)
                    ,7
                    ,1)
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') cntl
      ,decode(substr(to_char(ffvv.compiled_value_attributes)
                    ,9
                    ,1)
             ,'N'
             ,'否'
             ,'Y'
             ,'是'
             ,'') recon
FROM fnd_flex_value_sets     ffvs
    ,fnd_flex_values_vl      ffvv
    ,fnd_flex_hierarchies_vl ffh
WHERE 1 = 1
AND ffvv.enabled_flag = 'Y'
AND trunc(SYSDATE) BETWEEN nvl(ffvv.start_date_active
                             ,trunc(SYSDATE - 1)) AND
      nvl(ffvv.end_date_active
         ,trunc(SYSDATE + 1))
AND ffvv.flex_value_set_id = ffvs.flex_value_set_id
AND ffvv.flex_value_set_id = ffh.flex_value_set_id(+)
AND ffvv.structured_hierarchy_level = ffh.hierarchy_id(+)
AND flex_value_set_name LIKE 'XXX%'--這個地方是值集名稱,不同項目的值集名稱不同
ORDER BY ffvv.flex_value
發佈了64 篇原創文章 · 獲贊 4 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章