DBA Data[Home] [Help]

PACKAGE: APPS.BSC_BSC_ADAPTER

Source


1 package BSC_BSC_ADAPTER AS
2 /*$Header: BSCBSCMS.pls 120.6 2006/02/15 17:57:53 arsantha noship $*/
3 --program runtime parameters
4 g_debug boolean;
5 g_status boolean;
6 g_status_message varchar2(4000);
7 g_apps_owner varchar2(200);
8 g_bsc_owner varchar2(200);
9 g_prod_owner varchar2(200);
10 g_options BSC_IM_UTILS.varchar_tabletype;
11 g_number_options number;
12 g_stmt varchar2(32000);
13 ---
14 g_periodicity_id_for_type BSC_IM_UTILS.number_tabletype;
15 ---
16 g_rec_count number;
17 g_create_dbi_dim_tables boolean;
18 ---
19 type cal_refreshed is record(
20 calendar_id number);
21 type tab_cal_refreshed is table of cal_refreshed index by pls_integer;
22 
23 g_calendars_refreshed tab_cal_refreshed;
24 
25 ---
26 type cal_record is record(
27 calendar_year number,
28 calendar_month number,
29 calendar_day number,
30 year number,
31 semester number,
32 bimester number,
33 quarter number,
34 month number,
35 week52 number,
36 day365 number,
37 custom_1 number,
38 custom_2 number,
39 custom_3 number,
40 custom_4 number,
41 custom_5 number,
42 custom_6 number,
43 custom_7 number,
44 custom_8 number,
45 custom_9 number,
46 custom_10 number,
47 custom_11 number,
48 custom_12 number,
49 custom_13 number,
50 custom_14 number,
51 custom_15 number,
52 custom_16 number,
53 custom_17 number,
54 custom_18 number,
55 custom_19 number,
56 custom_20 number);
57 type cal_record_table is table of cal_record;
58 ------------
59 type cal_periodicity is record(
60 periodicity_id number,
61 source varchar2(4000),
62 db_column_name varchar2(200),
63 periodicity_type number,
64 period_type_id integer,
65 record_type_id integer,
66 xtd_pattern varchar2(4000));
67 type cal_periodicity_table is table of cal_periodicity;
68 -----------
69 g_rec_dbi_dim BSC_UPDATE_DIM.t_array_dbi_dim_data;
70 -----------
71 --functions--------------------------------------------------------
72 function get_time return varchar2 ;
73 function init_all return boolean;
74 function load_metadata_for_indicators(
75 p_indicator varchar2,
76 p_options BSC_IM_UTILS.varchar_tabletype,
77 p_number_options number
78 )return boolean;
79 function read_metadata(
80 p_indicators BSC_IM_UTILS.number_tabletype,
81 p_number_indicators number,
82 p_final_dimensions out nocopy BSC_IM_UTILS.varchar_tabletype,
83 p_number_final_dimensions out nocopy number
84 ) return boolean;
85 function read_kpi_required(
86 p_indicators BSC_IM_UTILS.number_tabletype,
87 p_indicator_names BSC_IM_UTILS.varchar_tabletype,
88 p_number_indicators number
89 ) return boolean;
90 function get_table_cols(
91 p_table_name varchar2,
92 p_col_table in out nocopy BSC_IM_UTILS.varchar_tabletype,
93 p_cols in out nocopy BSC_IM_UTILS.varchar_tabletype,
94 p_col_type in out nocopy BSC_IM_UTILS.varchar_tabletype,
95 p_source_column in out nocopy BSC_IM_UTILS.varchar_tabletype,
96 p_source_formula in out nocopy BSC_IM_UTILS.varchar_tabletype,
97 p_number_cols in out nocopy number
98 ) return boolean;
99 function get_table_periodicity(p_table_name varchar2) return number;
100 function get_s_sb_tables(
101 p_indicator_id number,
102 p_s_tables out nocopy BSC_IM_UTILS.varchar_tabletype,
103 p_s_periodicity out nocopy BSC_IM_UTILS.number_tabletype,
104 p_number_s_tables out nocopy number
105 )return boolean;
106 function get_kpi_periodicity(
107 p_indicator_id number,
108 p_periodicity out nocopy BSC_IM_UTILS.number_tabletype,
109 p_number_periodicity out nocopy number
110 )return boolean;
111 function get_db_calculation(
112 p_indicator number,
113 p_s_table varchar2,
114 p_type number,
115 p_calculation_table in out nocopy BSC_IM_UTILS.varchar_tabletype,
116 p_calculation_type in out nocopy BSC_IM_UTILS.varchar_tabletype,
117 p_parameter1 in out nocopy BSC_IM_UTILS.varchar_tabletype,
118 p_parameter2 in out nocopy BSC_IM_UTILS.varchar_tabletype,
119 p_parameter3 in out nocopy BSC_IM_UTILS.varchar_tabletype,
120 p_parameter4 in out nocopy BSC_IM_UTILS.varchar_tabletype,
121 p_parameter5 in out nocopy BSC_IM_UTILS.varchar_tabletype,
122 p_number_parameters in out nocopy number
123 ) return boolean;
124 function get_table_relations(
125 p_table varchar2,
126 p_tables in out nocopy BSC_IM_UTILS.varchar_tabletype,
127 p_source_tables in out nocopy BSC_IM_UTILS.varchar_tabletype,
128 p_relation_type in out nocopy BSC_IM_UTILS.varchar_tabletype,
129 p_number_tables in out nocopy number
130 ) return boolean ;
131 function get_summarize_calendar(
132 p_periodicity number,
133 p_calendar out nocopy varchar2,
134 p_calendar_tables out nocopy varchar2,
135 p_calendar_alias out nocopy varchar2,
136 p_calendar_join_1 out nocopy varchar2,
137 p_calendar_join_2 out nocopy varchar2
138 )return boolean ;
139 function get_columns_in_formula(
140 p_expression varchar2,
141 p_measure BSC_IM_UTILS.varchar_tabletype,
142 p_number_measure number,
143 p_table out nocopy BSC_IM_UTILS.varchar_tabletype,
144 p_number_table out nocopy number
145 )return boolean;
146 function get_period_type_id(p_level varchar2) return number;
147 function find_xtd_levels(
148 p_periodicity number,
149 p_xtd_levels out nocopy BSC_IM_UTILS.varchar_tabletype,
150 p_number_xtd_levels out nocopy number
151 )return boolean ;
152 function load_reporting_calendar(
153 p_options BSC_IM_UTILS.varchar_tabletype,
154 p_number_options number
155 )return boolean;
156 --Fix bug#4027813 This function created to load reporting calendar only for the specified
157 --calendar id
158 function load_reporting_calendar(
159 p_calendar_id number,
160 p_options BSC_IM_UTILS.varchar_tabletype,
161 p_number_options number
162 )return boolean;
163 function load_reporting_calendar(
164 p_calendar_id number,
165 p_calendar_type varchar2,
166 p_hierarchy varchar2,
167 p_hierarchy_type varchar2,
168 p_periodicity_data cal_periodicity_table,
169 p_number_periodicity_data number
170 )return boolean;
171 function load_reporting_calendar_DBI(
172 p_calendar_id number,
173 p_calendar_type varchar2,
174 p_hierarchy varchar2,
175 p_hierarchy_type varchar2,
176 p_calendar_data cal_record_table,
177 p_number_calendar_data number,
178 p_periodicity_data cal_periodicity_table,
179 p_number_periodicity_data number
180 )return boolean;
181 function get_calendar_data(
182 p_calendar_id number,
183 p_calendar_data out nocopy cal_record_table,
184 p_number_calendar_data out nocopy number
185 ) return boolean;
186 function get_periodicity_data(
187 p_calendar_id number,
188 p_calendar_type number,
189 p_periodicity_data out nocopy cal_periodicity_table,
190 p_number_periodicity_data out nocopy number
191 )return boolean;
192 function get_calendar_for_periodicity(p_periodicity number) return number;
193 function get_reporting_calendar_name return varchar2;
194 function get_table_fks(
195 p_s_tables BSC_IM_UTILS.varchar_tabletype,
196 p_number_s_tables number,
197 p_fk out nocopy BSC_IM_UTILS.varchar_tabletype,
198 p_number_fk out nocopy number
199 ) return boolean;
200 function get_table_fks(
201 p_table varchar2,
202 p_fk out nocopy BSC_IM_UTILS.varchar_tabletype,
203 p_number_fk out nocopy number
204 ) return boolean;
205 function get_table_measures(
206 p_s_tables BSC_IM_UTILS.varchar_tabletype,
207 p_number_s_tables number,
208 p_measures out nocopy BSC_IM_UTILS.varchar_tabletype,
209 p_number_measures out nocopy number
210 ) return boolean;
211 function get_table_measures(
212 p_table varchar2,
213 p_measures out nocopy BSC_IM_UTILS.varchar_tabletype,
214 p_number_measures out nocopy number
215 ) return boolean;
216 function get_level_for_pk(
217 p_level_pk varchar2,
218 p_level out nocopy varchar2,
219 p_src_object out nocopy varchar2, --only populated if this is a DBI dimension
220 p_special_dim out nocopy varchar2,
221 p_rec_dim out nocopy boolean,
222 p_rec_dim_key out nocopy varchar2
223 )return boolean;
224 function get_table_sql(
225 p_table varchar2,
226 p_table_sql out nocopy varchar2,
227 p_b_tables in out nocopy BSC_IM_UTILS.varchar_tabletype,
228 p_number_b_tables in out nocopy number,
229 p_dim_level_tables in out nocopy BSC_IM_UTILS.varchar_tabletype,
230 p_number_dim_level_tables in out nocopy number
231 )return boolean;
232 function read_kpi_map_info(
233 p_indicator number,
234 p_periodicity BSC_IM_UTILS.number_tabletype,
235 p_number_periodicity number
236 )return boolean;
237 function create_kpi_map_info(
238 p_indicator number,
239 p_map_name varchar2,
240 p_mv_name varchar2,
241 p_zero_code_mv_name varchar2,
242 p_zero_code_map_name varchar2,
243 p_s_tables BSC_IM_UTILS.varchar_tabletype,
244 p_number_s_tables number
245 )return boolean ;
246 function get_filter_stmt(
247 p_indicator number,
248 p_table varchar2,
249 p_filter_from out nocopy BSC_IM_UTILS.varchar_tabletype,
250 p_filter_where out nocopy BSC_IM_UTILS.varchar_tabletype,
251 p_number_filter out nocopy number,
252 p_dim_level_tables in out nocopy BSC_IM_UTILS.varchar_tabletype,
253 p_number_dim_level_tables in out nocopy number,
254 p_filter_first_level out nocopy BSC_IM_UTILS.varchar_tabletype,
255 p_filter_first_level_alias out nocopy BSC_IM_UTILS.varchar_tabletype, --this will be the alias L1
256 p_filter_first_level_fk out nocopy BSC_IM_UTILS.varchar_tabletype,
257 p_num_filter_first_level out nocopy number
258 ) return boolean;
259 function get_dim_level_cols(
260 p_level varchar2,
261 p_columns out nocopy BSC_IM_UTILS.varchar_tabletype,
262 p_column_type out nocopy BSC_IM_UTILS.varchar_tabletype,
263 p_number_columns out nocopy number
264 )return boolean;
265 function get_s_tables_for_mv(
266 p_mv varchar2,
267 p_s_tables out nocopy BSC_IM_UTILS.varchar_tabletype,
268 p_number_s_tables out nocopy number
269 )return boolean;
270 function built_hier(
271 p_calendar_id number,
272 p_calendar_type number,
273 p_periodicity_data cal_periodicity_table,
274 p_number_periodicity_data number,
275 p_hier out nocopy BSC_IM_UTILS.varchar_tabletype,
276 p_hier_type out nocopy BSC_IM_UTILS.varchar_tabletype,
277 p_number_hier out nocopy number
278 )return boolean;
279 function get_periodicity_for_type(
280 p_periodicity_type number,
281 p_periodicity_data cal_periodicity_table,
282 p_number_periodicity_data number
283 )return number;
284 function built_hier_rec(
285 p_parent number,
286 p_parent_hier BSC_IM_UTILS.number_tabletype,
287 p_child_hier BSC_IM_UTILS.number_tabletype,
288 p_parent_type BSC_IM_UTILS.varchar_tabletype,
289 p_number_rel number,
290 p_hier out nocopy BSC_IM_UTILS.varchar_tabletype,
291 p_hier_type out nocopy BSC_IM_UTILS.varchar_tabletype,
292 p_number_hier out nocopy number
293 )return boolean;
294 function set_xtd_pattern(
295 p_calendar_id number,
296 p_periodicity_data in out nocopy cal_periodicity_table,
297 p_number_periodicity_data number,
298 p_hier BSC_IM_UTILS.varchar_tabletype,
299 p_hier_type BSC_IM_UTILS.varchar_tabletype,
300 p_number_hier number
301 )return boolean;
302 function get_xtd_pattern(
303 p_periodicity_id number,
304 p_hier varchar2,
305 p_periodicity_data cal_periodicity_table,
306 p_number_periodicity_data number
307 ) return number;
308 function get_period_type_id_for_period(
309 p_periodicity_id number,
310 p_periodicity_data cal_periodicity_table,
311 p_number_periodicity_data number
312 )return number;
313 function get_period_type_id_for_period(
314 p_periodicity_id number
315 )return number;
316 ------
317 --bug 3324876
318 function get_filter_view_params(
319 p_indicator number,
320 p_level varchar2,
321 p_source_type out nocopy number,
322 p_source_code out nocopy number,
323 p_dim_level_id out nocopy number
324 ) return number;
325 function get_filter_stmt_rec(
326 p_indicator number,
327 p_child_level varchar,
328 p_child_level_pk varchar,
329 p_count in out nocopy number,
330 p_level_count in out nocopy number,
331 p_from_stmt in out nocopy varchar2,
332 p_where_stmt in out nocopy varchar2,
333 --added by arun
334 p_pk_cols  BSC_IM_UTILS.varchar_tabletype
335 ) return boolean;
336 function get_parent_level(
337 p_child_level varchar2,
338 p_level_fk out nocopy BSC_IM_UTILS.varchar_tabletype,
339 p_parent_level out nocopy BSC_IM_UTILS.varchar_tabletype,
340 p_num_parent_levels out nocopy number
341 ) return boolean;
342 function load_rpt_cal_DBI_rolling(
343 p_calendar_id number,
344 p_calendar_type varchar2,
345 p_hierarchy varchar2,
346 p_hierarchy_type varchar2,
347 p_calendar_data cal_record_table,
348 p_number_calendar_data number,
349 p_periodicity_data cal_periodicity_table,
350 p_number_periodicity_data number
351 )return boolean ;
352 function get_level_short_name(p_table_name varchar2) return varchar2 ;
353 function create_dbi_dim_tables return boolean ;
354 procedure get_list_of_rec_dim(
355 p_dim_list out nocopy bsc_varchar2_table_type,
356 p_num_dim_list out nocopy number,
357 p_error_message out nocopy varchar2);
358 procedure get_list_of_rec_dim(
359 p_dim_list out nocopy BSC_UPDATE_DIM.t_array_dbi_dim_data
360 );
361 procedure set_and_get_dim_sql(
362 p_dim_level_short_name bsc_varchar2_table_type,
363 p_dim_level_value bsc_varchar2_table_type,
364 p_num_dim_level number,
365 p_dim_level_sql out nocopy bsc_varchar2_table_type,
366 p_error_message out nocopy varchar2
367 );
368 procedure create_int_md_fk(
369 p_mv_name varchar2
370 );
371 --procedures-------------------------------------------------------
372 procedure write_to_log_file(p_message varchar2);
373 procedure write_to_log_file_n(p_message varchar2);
374 procedure write_to_debug_n(p_message varchar2);
375 procedure write_to_debug(p_message varchar2);
376 procedure set_globals(p_debug boolean);
377 -------------------------------------------------------------------
378 
379 END BSC_BSC_ADAPTER;