The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT LEVEL_TABLE_NAME,SHORT_NAME, upper(level_pk_col) level_pk_col
FROM
BSC_SYS_DIM_LEVELS_B WHERE level_table_name in
(select level_table_name
from bsc_kpi_dim_levels_b kpi,
bsc_tmp_opt_ui_kpis gdb
where gdb.indicator=kpi.indicator
and gdb.prototype_flag <> 2
and gdb.process_id = bsc_metadata_optimizer_pkg.g_ProcessId);
cursor c1 is select column_name from bsc_db_tables_cols where table_name = p_table_name;
cursor c1 is select column_name from bsc_db_tables_cols where table_name=p_b_table_name
order by column_type desc;
l_stmt := 'select ';
select 1 from bsc_sys_periodicities
where
calendar_id = p_calendar_id
and (period_type_id is null or record_type_id is null )
--ignoring xtd pattern due to PMD bug 4503527 not having an upgrade script yet
--or xtd_pattern is null )
and periodicity_type not in (11,12);
select calendar_id into l_calendar_id from bsc_kpis_vl where indicator=p_indicator;
p_options.delete;
l_select_sql varchar2(32000);
l_select_sql_inc varchar2(32000);--for incremental mv sql
l_select_basic varchar2(32000);
l_select_no_aggregation varchar2(32000);
l_rollup_select_sql BSC_IM_UTILS.varchar_tabletype;
l_rollup_full_select_sql varchar2(32000);
ll_column_merge_sql(i):='select ';
ll_column_merge_sql(i):=ll_column_merge_sql(i)||'select /*+ full('||ll_column_merge_group(j)||') */';
ll_merge_sql := ' (
l_select_sql:=null;
l_select_sql_inc:=null;
l_select_sql:='select ';
l_select_sql_inc:=null;
l_select_sql:=l_select_sql||l_source_tables(ll_index)||'.'||l_cols(ll_fk_index)||' '||
l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||l_source_tables(ll_index)||'.'||l_cols(ll_fk_index)||' '||l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||'nvl('||ll_temp_alias||'.'||ll_rec_dim_key||','||
l_source_tables(ll_index)||'.'||l_cols(ll_fk_index)||') '||l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||ll_temp_alias||'.'||l_cols(ll_fk_index)||' '||l_cols(ll_fk_index)||',';
changes to the dim levels like dim deletes, dim updates etc
these dim levels are also added to l_dim_level_tables so mv logs can be created on them
here, l_cols(ll_fk_index)=l_col_source(ll_fk_index)
*/
/*
please see the above section on E2E kpi and need for materializing the dbi views
*/
--ll_dim_src_object does not have the language column.
--it has code, maybe parent code and effective dates etc
if get_level_for_pk(l_cols(ll_fk_index),ll_temp,ll_dim_src_object,ll_dim_src_object_type,
ll_rec_dim,ll_rec_dim_key)=false then
return false;
l_select_sql:=l_select_sql||'nvl('||ll_temp_alias||'.'||ll_rec_dim_key||','||
l_source_tables(ll_index)||'.'||l_cols(ll_fk_index)||') '||l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||ll_temp_alias||'.'||ll_rec_dim_key ||' '||l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||l_source_tables(ll_index)||'.'||l_cols(ll_fk_index)||' '||
l_cols(ll_fk_index)||',';
l_select_sql:=l_select_sql||l_source_tables(ll_index)||'.'||l_fk(j)||' '||l_fk(j)||',';
l_select_no_aggregation := l_select_sql;
l_select_no_aggregation := l_select_no_aggregation||' '||l_cols(j)||',';
write_to_log_file(' adding to no agg select :'|| l_select_no_aggregation);
l_select_sql:=l_select_sql||l_col_formula(j)||' '||l_cols(j)||',';
l_select_sql_inc:=l_select_sql_inc||',count('||lll_agg_columns(j)||') '||
substr('cnt_'||lll_agg_columns(j),1,27)||'_'||j;
l_select_sql_inc:=l_select_sql_inc||',count(*) count_all';
l_select_no_aggregation := substr(l_select_no_aggregation,1, length(l_select_no_aggregation)-1);
l_select_no_aggregation := l_select_no_aggregation||',decode('||l_source_tables(ll_index)||'.periodicity_id,';
l_select_sql:=substr(l_select_sql,1,length(l_select_sql)-1);
l_select_sql:=l_select_sql||',decode('||l_source_tables(ll_index)||'.periodicity_id,';
l_select_sql:=l_select_sql||l_table_periodicity(j)||','||l_table_period_type_id(j)||',';
l_select_no_aggregation := l_select_no_aggregation|| l_table_periodicity(j)||','||l_table_period_type_id(j)||',';
l_select_sql:=l_select_sql||'null) period_type_id';
l_select_no_aggregation := l_select_no_aggregation||'null) period_type_id';
l_select_basic := l_select_sql;
l_where_sql:=l_where_sql||' and not exists (select 1 from '||l_eliminate(ll_index)||' where '||
l_eliminate_sql||')';
l_from_sql := replace(l_from_sql, '
write_to_log_file_n('select no agg = '||l_select_no_aggregation);
write_to_log_file_n('select sql='||l_select_sql);
write_to_log_file_n('select sql inc='||l_select_sql_inc);
l_select_sql := 'select '||l_hint_sql||')*/ '||substr(l_select_sql, 7, length(l_select_sql));
l_select_sql := 'select '||l_hint_sql||')*/ '||substr(l_select_no_aggregation, 7, length(l_select_no_aggregation));
if BSC_IM_INT_MD.create_mapping_detail(p_map_name,'BSC',l_select_sql,'SELECT',null)=false then
return false;
if BSC_IM_INT_MD.create_mapping_detail(p_map_name,'BSC',l_select_sql_inc,'SELECT INC',null)=false then
return false;
l_rollup_full_select_sql:=' select ';
l_rollup_select_sql(j):=' select ';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||ll_union_key_values(ll_index)||' '||
ll_union_keys(ll_index)||',';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||l_fk(k)||',';
l_rollup_full_select_sql:=l_rollup_full_select_sql||'decode(grouping('||ll_rollup_fk(ll_index)||'),'||
'1,'||ll_rollup_fk_value(ll_index)||','||ll_rollup_fk(ll_index)||') '||ll_rollup_fk(ll_index)||',';
l_rollup_full_select_sql:=l_rollup_full_select_sql||l_fk(k)||',';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||
l_parameter5(m)||' '||l_parameter3(m)||',';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||'count('||l_parameter3(m)||') '||
substr('cnt_'||l_parameter3(m),1,30)||',';
l_rollup_full_select_sql:=l_rollup_full_select_sql||
l_parameter5(m)||' '||l_parameter3(m)||',';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||' count(*) count_all,'||j||' u_marker,';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||'decode(periodicity_id,';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||l_table_periodicity(k)||','||
l_table_period_type_id(k)||',';
l_rollup_select_sql(j):=l_rollup_select_sql(j)||'null) period_type_id';
l_rollup_full_select_sql:=l_rollup_full_select_sql||'decode(periodicity_id,';
l_rollup_full_select_sql:=l_rollup_full_select_sql||l_table_periodicity(j)||','||
l_table_period_type_id(j)||',';
l_rollup_full_select_sql:=l_rollup_full_select_sql||'null) period_type_id';
write_to_log_file_n('The rollup select from where and group by');
write_to_log_file('select - '||l_rollup_select_sql(j));
write_to_log_file_n('The FULL rollup select from where and group by');
write_to_log_file('FULL select - '||l_rollup_full_select_sql);
if BSC_IM_INT_MD.create_mapping_detail(p_zero_code_map_name,'BSC',l_rollup_select_sql(j),'SELECT',null)=false then
return false;
if BSC_IM_INT_MD.create_mapping_detail(p_zero_code_map_name,'BSC',l_rollup_full_select_sql,
'SELECT',null)=false then
return false;
if BSC_IM_INT_MD.create_mapping_detail(l_full_zero_code_map_name,'BSC',l_rollup_full_select_sql,
'SELECT',null)=false then
return false;
l_column_merge_sql:='select ';
l_column_merge_sql:=l_column_merge_sql||'select ';
p_table_sql:='select ';
SELECT d.level_pk_col, d.level_view_name FROM bsc_kpi_dim_levels_b d, bsc_db_tables_cols c
WHERE d.indicator = p_indicator AND d.dim_set_id = p_dim_set_id AND d.status = p_status AND d.level_view_name <> (
SELECT level_view_name FROM bsc_sys_dim_levels_b s WHERE d.level_pk_col = s.level_pk_col)
AND c.table_name = p_table_name AND c.column_name = d.level_pk_col AND
c.column_type = p_column_type;
select level_table_name,level_pk_col,parent_level_rel from bsc_kpi_dim_levels_b
where indicator=p_indicator and dim_set_id=p_set_id;
SELECT indicator, dim_set_id into l_indicator_id,l_dim_set_id
FROM bsc_kpi_data_tables_v WHERE (table_name = p_table OR
table_name = (SELECT DISTINCT table_name FROM bsc_db_calculations WHERE
parameter1 = p_table AND calculation_type = 5)) and rownum=1;
l_stmt:='SELECT d.level_pk_col, d.level_view_name FROM bsc_kpi_dim_levels_b d, bsc_db_tables_cols c '||
'WHERE d.indicator = :1 AND d.dim_set_id = :2 AND d.status = :3 AND d.level_view_name <> ( '||
'SELECT level_view_name FROM bsc_sys_dim_levels_b s WHERE d.level_pk_col = s.level_pk_col) '||
'AND c.table_name = :4 AND c.column_name = d.level_pk_col AND '||
'c.column_type = :5';
l_stmt:='select level_table_name,level_pk_col,parent_level_rel'||
' from bsc_kpi_dim_levels_b where indicator=:1 and dim_set_id=:2';
select source_type,source_code,dim_level_id from bsc_sys_filters_views where
level_table_name=p_table_name
and source_code in (select tab_id from bsc_tab_indicators where indicator=p_ind);
select 1 from bsc_sys_filters where source_type=p_type and source_code=p_code
and dim_level_id=p_id and rownum=1;
l_stmt:='select source_type,source_code,dim_level_id from bsc_sys_filters_views where '||
'level_table_name=:1 and source_code in (select tab_id from bsc_tab_indicators where indicator=:2';
l_stmt:='select 1 from bsc_sys_filters where source_type=:1 and source_code=:2 '||
'and dim_level_id=:3 and rownum=1';
select
par_lvl.level_table_name,
rel.relation_col
from
bsc_sys_dim_levels_b lvl,
bsc_sys_dim_levels_b par_lvl,
bsc_sys_dim_level_rels rel
where
lvl.level_table_name=p_level
and lvl.dim_level_id=rel.dim_level_id
and rel.relation_type=1
and par_lvl.dim_level_id=rel.parent_dim_level_id;
write_to_log_file_n('select par_lvl.level_table_name,rel.relation_col from bsc_sys_dim_levels_b lvl,'||
'bsc_sys_dim_levels_b par_lvl,bsc_sys_dim_level_rels rel where lvl.level_table_name='''||p_child_level||''''||
'and lvl.dim_level_id=rel.dim_level_id and rel.relation_type=1 and par_lvl.dim_level_id=rel.parent_dim_level_id');
select decode(data_length, null, data_type, data_type||'('||data_length||')') data_type
from all_tab_columns
where owner=p_owner
and table_name=p_dim_level
and column_name = p_level_pk;
select short_name from bsc_sys_dim_levels_b
where level_table_name=p_dim_level;
cursor c1(p_col varchar2) is select level_table_name,short_name from bsc_sys_dim_levels_b where upper(level_pk_col)=upper(p_col);
l_dbi_dim_data BSC_UPDATE_DIM.t_dbi_dim_data;
l_stmt:='select level_table_name,short_name from bsc_sys_dim_levels_b where level_pk_col=:1';
BSC_UPDATE_DIM.Get_Dbi_Dim_Data(l_name,l_dbi_dim_data);
p_src_object:='(Select '||l_dbi_dim_data.child_col||' code,'||l_dbi_dim_data.parent_col||' parent_code from '||
l_dbi_dim_data.denorm_table||' where ('||l_dbi_dim_data.parent_level_col||'<='||
l_dbi_dim_data.top_n_levels_in_mv||') ';
p_src_object:='(Select '||l_dbi_dim_data.code_col||' CODE from '||l_dbi_dim_data.from_clause||
l_dbi_dim_data.where_clause||') ';
p_src_object:='(Select '||l_dbi_dim_data.code_col||' CODE from '||l_dbi_dim_data.from_clause||
l_dbi_dim_data.where_clause||') ';
select table_name,upper(column_name),column_type,source_formula,source_column
from bsc_db_tables_cols where table_name=p_table
order by column_name;
l_stmt:='select table_name,upper(column_name),column_type,source_formula,upper(source_column) '||
'from bsc_db_tables_cols where table_name=:1';
is select periodicity_id from bsc_db_tables where table_name=p_table;
l_stmt:='select periodicity_id from bsc_db_tables where table_name=:1';
is select distinct bsc_db_tables_cols.column_name,bsc_kpi_dim_levels_b.dim_level_index from
bsc_kpi_data_tables,
bsc_db_tables_cols,
bsc_kpi_dim_levels_b
where
bsc_kpi_data_tables.table_name=bsc_db_tables_cols.table_name
and bsc_db_tables_cols.table_name =p_table
and bsc_db_tables_cols.column_type='P'
and bsc_kpi_data_tables.indicator=bsc_kpi_dim_levels_b.indicator
and bsc_db_tables_cols.column_name=bsc_kpi_dim_levels_b.level_pk_col
and bsc_kpi_data_tables.dim_set_id=bsc_kpi_dim_levels_b.dim_set_id
order by bsc_kpi_dim_levels_b.dim_level_index;
is select distinct bsc_db_tables_cols.column_name,all_tab_columns.column_id
from
bsc_db_tables_cols ,
all_tab_columns
where bsc_db_tables_cols.table_name =p_table
and bsc_db_tables_cols.column_type='P'
and all_tab_columns.table_name(+)=p_table
and all_tab_columns.column_name(+)=bsc_db_tables_cols.column_name
and all_tab_columns.owner(+)=p_owner
order by all_tab_columns.column_id;
write_to_log_file_n('is select distinct bsc_db_tables_cols.column_name,all_tab_columns.column_id...');
is select distinct column_name from bsc_db_tables_cols where table_name =p_table_name and
column_type='A' order by column_name;
l_stmt:='select distinct column_name from bsc_db_tables_cols where table_name =:1 and '||
'column_type=''A''';
is select periodicity_id from bsc_kpi_periodicities where indicator=p_indicator;
l_stmt:='select periodicity_id from bsc_kpi_periodicities where indicator=:1';
select distinct upper(table_name), substr(table_name, instr(table_name, '_', -1, 1)+1) periodicity_id from bsc_db_tables_rels
where instr(table_name, 'BSC_S_'||p_indicator||'_') =1 or instr(table_name, 'BSC_SB_'||p_indicator||'_') =1;
is select distinct rel.source_table_name, tab.periodicity_id
from bsc_db_tables_rels rel, bsc_db_tables tab
where rel.table_name in
(select distinct upper(table_name) from bsc_kpi_data_tables where indicator=p_indicator)
and rel.source_table_name like 'BSC_SB_%'
and rel.source_table_name=tab.table_name ;
l_stmt:='select distinct upper(table_name),periodicity_id from bsc_kpi_data_tables where indicator=:1 '||
'and table_name is not null';
l_stmt:='select distinct rel.source_table_name, tab.periodicity_id '||
'from bsc_db_tables_rels rel, bsc_db_tables tab '||
'where rel.table_name in '||
'(select distinct upper(table_name) from bsc_kpi_data_tables where indicator=:1) '||
'and rel.source_table_name like ''BSC_SB_%'' '||
'and rel.source_table_name=tab.table_name ';
is select table_name,calculation_type,parameter1,'''0''',upper(parameter3),parameter4,parameter5
from bsc_db_calculations where table_name=p_table
order by upper(parameter3),parameter1;
is select table_name,calculation_type,parameter1,'''0''',upper(parameter3),parameter4,parameter5
from bsc_db_calculations where table_name=p_table
and calculation_type=p_type
order by upper(parameter3),parameter1;
is select cols.data_type
from all_tab_columns cols,
bsc_kpi_dim_levels_b dim
where cols.table_name = dim.level_table_name
and cols.column_name = 'CODE'
and dim.indicator = p_indicator
and dim.level_pk_col = p_column
and cols.owner = bsc_im_utils.get_table_owner(dim.level_table_name) ;
l_stmt:='select table_name,calculation_type,parameter1,0,upper(parameter3),parameter4,parameter5 '||
'from bsc_db_calculations where table_name=:1 ';
l_stmt:=' select cols.data_type from '||bsc_olap_main.g_col_type_table_name||' cols,
bsc_kpi_dim_levels_b dim where dim.indicator = :1
and dim.level_pk_col = :2 and cols.level_table_name = dim.level_table_name';
is select table_name,source_table_name,relation_type from bsc_db_tables_rels where
table_name=p_table_name;
l_stmt:='select table_name,source_table_name,relation_type from bsc_db_tables_rels where '||
'table_name=:1';
is select calendar_id from bsc_sys_periodicities where periodicity_id=p_id;
l_stmt:='select calendar_id from bsc_sys_periodicities where periodicity_id=:1';
cursor c1 is select periodicity_id,source,db_column_name from bsc_sys_periodicities;
g_stmt:='select periodicity_id,source,db_column_name from bsc_sys_periodicities';
p_calendar:='(select distinct ';
is select db_column_name,period_col_name from bsc_sys_periodicities where periodicity_id=p_id;
l_stmt:='select db_column_name,period_col_name from bsc_sys_periodicities where periodicity_id=:1';
cursor c1 is select calendar_id,decode(edw_calendar_type_id,null,0,1,decode(edw_calendar_id,1001,2,1))
from bsc_sys_calendars_b;
write_to_log_file_n('select calendar_id from bsc_sys_calendars_b');
cursor c1 is select decode(edw_calendar_type_id,null,0,1,decode(edw_calendar_id,1001,2,1))
from bsc_sys_calendars_b
where calendar_id = p_calendar_id;
write_to_log_file_n('select decode(edw_calendar_type_id,null,0,1,decode(edw_calendar_id,1001,2,1))'||
' from bsc_sys_calendars_b where calendar_id=p_calendar_id');
is select calendar_year,calendar_month,calendar_day,year,semester,bimester,quarter,month,
week52,day365,custom_1,custom_2,custom_3,custom_4,custom_5,custom_6,custom_7,
custom_8,custom_9,custom_10,custom_11,custom_12,custom_13,custom_14,custom_15,
custom_16,custom_17,custom_18,custom_19,custom_20 from bsc_db_calendar where calendar_id=p_calendar_id
order by calendar_year,calendar_month,calendar_day;
write_to_log_file_n('select calendar_year,calendar_month,calendar_day,year,semester,bimester,quarter,month, '||
'week52,day365,custom_1,custom_2,custom_3,custom_4,custom_5,custom_6,custom_7, '||
'custom_8,custom_9,custom_10,custom_11,custom_12,custom_13,custom_14,custom_15, '||
'custom_16,custom_17,custom_18,custom_19,custom_20 from bsc_db_calendar where calendar_id='||p_calendar_id||
'order by calendar_year,calendar_month,calendar_day');
select periodicity_id,source,db_column_name,periodicity_type,
period_type_id,record_type_id,xtd_pattern from bsc_sys_periodicities
where calendar_id=p_calendar_id and periodicity_type not in (11,12);
write_to_log_file_n('select periodicity_id,source,db_column_name,periodicity_type,'||
'period_type_id,record_type_id,xtd_pattern from bsc_sys_periodicities '||
'where calendar_id='||p_calendar_id||' and periodicity_type not in (11,12)');
execute immediate 'update bsc_sys_periodicities set period_type_id=:1,'||
'record_type_id=:2,xtd_pattern=:3 '||
'where calendar_id=:4 and periodicity_id=:5' using p_periodicity_data(i).period_type_id,
p_periodicity_data(i).record_type_id,p_periodicity_data(i).xtd_pattern,p_calendar_id,
p_periodicity_data(i).periodicity_id;
cursor c1(p_periodicity number) is select period_type_id from bsc_sys_periodicities where
periodicity_id=p_periodicity;
write_to_log_file_n('select period_type_id from bsc_sys_periodicities where periodicity_id='||
p_periodicity_id);
select to_char(systimestamp, 'HHMISSFF') into randomString from dual; --Bug 4027813
'cursor c1 is select calendar_year,calendar_month,calendar_day'||newline;
l_stmt:=l_stmt||'l_'||l_period_column(1)||'_'||l_period_column(j)||'.delete;'||newline;
l_stmt:=l_stmt||'l_'||l_period_column(j)||'_period_count.delete;'||newline;
l_stmt:=l_stmt||'-------------------------'||newline||'---Insert into Reporting Calendar Table'||newline;
'insert into BSC_REPORTING_CALENDAR(calendar_id,calendar_type,report_date,period,year,period_type_id,'||newline||
'record_type_id,periodicity_id,hierarchy,day_count,rolling_flag,created_by,last_update_by,'||newline||
'last_update_login,creation_date,'||
'last_update_date) values ('||newline||
p_calendar_id||',''BSC'',l_final_report_date(i),l_final_period(i),l_final_year(i),'||
'l_final_period_type_id(i),l_final_period_type_id(i),l_final_periodicity_id(i),'||
''','||p_hierarchy||','',l_final_period_count(i),''N'','||
'0,0,0,sysdate,sysdate);'||newline;
l_year_quarter.delete;
l_quarter_day_count.delete;
l_year_month.delete;
l_month_day_count.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_month.delete;
l_month_day_count.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_day.delete;
l_year_day.delete;
l_week_day.delete;
'insert into BSC_REPORTING_CALENDAR(calendar_id,calendar_type,report_date,
period,year,period_type_id,record_type_id,periodicity_id,hierarchy,rolling_flag,day_count,
created_by,last_update_by,last_update_login,creation_date,last_update_date) values(
:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16)'
using p_calendar_id,'BSC',l_final_report_date(i),l_final_period(i),l_final_year(i),
l_final_period_type_id(i),l_final_record_type_id(i),l_final_periodicity_id(i),
','||p_hierarchy||',','N',l_final_day_count(i),0,0,0,sysdate,sysdate;
l_year_quarter.delete;
l_quarter_day_count.delete;
l_year_month.delete;
l_month_day_count.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_month.delete;
l_month_day_count.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_week.delete;
l_week_day_count.delete;
l_year_day.delete;
l_month_day.delete;
l_year_day.delete;
l_year_day.delete;
l_week_day.delete;
'insert into BSC_REPORTING_CALENDAR(calendar_id,calendar_type,report_date,
period,year,period_type_id,record_type_id,periodicity_id,hierarchy,rolling_flag,day_count,
created_by,last_update_by,last_update_login,creation_date,last_update_date) values(
:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16)'
using
p_calendar_id,'BSC',l_final_report_date(i),l_final_period(i),l_final_year(i),
l_final_period_type_id(i),l_final_record_type_id(i),l_final_periodicity_id(i),
','||p_hierarchy||',',l_rolling_flag,l_final_day_count(i),0,0,0,sysdate,sysdate;
is select column_name,column_type
from bsc_sys_dim_level_cols ,bsc_sys_dim_levels_b
where level_table_name=p_level_table_name
and bsc_sys_dim_level_cols.dim_level_id=bsc_sys_dim_levels_b.dim_level_id;
l_stmt:='select column_name,column_type '||
'from bsc_sys_dim_level_cols ,bsc_sys_dim_levels_b '||
'where level_table_name=:1 '||
'and bsc_sys_dim_level_cols.dim_level_id=bsc_sys_dim_levels_b.dim_level_id ';
is select distinct table_name from bsc_db_tables_rels
where substr(table_name, 1, length(p_mv_name_pattern))= p_mv_name_pattern;
l_stmt:='select table_name from bsc_kpi_data_tables where mv_name=:1';
l_stmt:='select table_name from bsc_db_tables where table_name like substr(:1,1,
length(:2)-3)||''%''';
cursor c1(p_table varchar2) is select short_name from bsc_sys_dim_levels_b where level_table_name=p_table;
write_to_log_file_n('In get_level_short_name->select short_name from bsc_sys_dim_levels_b where level_table_name='||
p_table_name);
write_to_log_file_n('Going to call bsc_update_dim.Create_Dbi_Dim_Tables');
if bsc_update_dim.Create_Dbi_Dim_Tables(l_error_message)=false then
BSC_IM_UTILS.g_status_message:=l_error_message;
write_to_log_file_n('Error bsc_update_dim.Create_Dbi_Dim_Tables '||l_error_message);
l_dbi_dim_data BSC_UPDATE_DIM.t_array_dbi_dim_data;
BSC_UPDATE_DIM.Get_All_Dbi_Dim_Data(l_dbi_dim_data);
p_dim_list out nocopy BSC_UPDATE_DIM.t_array_dbi_dim_data
) is
--
l_dbi_dim_data BSC_UPDATE_DIM.t_array_dbi_dim_data;
p_dim_list.delete;
BSC_UPDATE_DIM.Get_All_Dbi_Dim_Data(l_dbi_dim_data);
p_dim_level_sql(i):='select distinct '||g_rec_dbi_dim(j).parent_col||' from '||g_rec_dbi_dim(j).denorm_table||' where '||
g_rec_dbi_dim(j).parent_level_col||'=1';
l_stmt:='select '||g_rec_dbi_dim(j).parent_level_col||' from '||g_rec_dbi_dim(j).denorm_table||
' where '||g_rec_dbi_dim(j).parent_col||'=:1 and rownum=1';
p_dim_level_sql(i):='select '||g_rec_dbi_dim(j).child_col||' from '||g_rec_dbi_dim(j).denorm_table||' where '||
g_rec_dbi_dim(j).parent_col||' ';