[Home] [Help]
1081: --first find the highest S table for this kpi, dim_set, then reuse get_levels_for_table api
1082: --note we ignore the periodicity here
1083: FUNCTION get_highest_s_table(p_fact IN VARCHAR2, p_dim_set IN NUMBER) return VARCHAR2 IS
1084: CURSOR cSTable(p_table varchar2) IS
1085: select table_name, count(1) ct from bsc_db_calculations
1086: where table_name like p_table
1087: and calculation_type=4
1088: group by table_name
1089: having count(1)=
1088: group by table_name
1089: having count(1)=
1090: (
1091: select max(ct) from(
1092: select table_name, count(1) ct from bsc_db_calculations
1093: where table_name like p_table
1094: and calculation_type=4
1095: group by table_name )
1096: );
2047: function get_zero_code_levels(
2048: p_fact varchar2,
2049: p_dim_set varchar2) return BSC_DBGEN_STD_METADATA.tab_clsLevel is
2050: CURSOR cSTable(p_num_zero_code in number) IS
2051: select table_name, count(1) ct from bsc_db_calculations
2052: where table_name like 'BSC_S_%'||p_fact||'_'||p_dim_set||'%'
2053: and calculation_type=4
2054: group by table_name
2055: having count(1)= p_num_zero_code;