DBA Data[Home] [Help]

PACKAGE BODY: APPS.FII_AP_MV_REFRESH

Source


1 PACKAGE BODY  FII_AP_MV_REFRESH AS
2 /*$Header: FIIAPMVB.pls 115.1 2003/08/05 17:07:31 pslau noship $*/
3 
4 g_phase VARCHAR2(50);
5 g_debug_flag 	VARCHAR2(1) := NVL(FND_PROFILE.value('FII_DEBUG_MODE'), 'N');
6 g_retcode  VARCHAR2(20) := NULL;
7 
8 ---------------------------------------------------------------
9 -- PROCEDURE AP_REFRESH
10 ---------------------------------------------------------------
11 PROCEDURE AP_REFRESH(Errbuf        in out NOCOPY Varchar2,
12                      Retcode       in out NOCOPY Varchar2) IS
13 
14 	l_dir    VARCHAR2(50) := NULL;
15         l_min              DATE;
16         l_max              DATE;
17         l_check_time_dim   BOOLEAN;
18         l_parallel_degree   NUMBER := 0;
19         l_count             NUMBER := 0;
20 
21 BEGIN
22 
23    ------------------------------------------------------
24    -- Set default directory in case if the profile option
25    -- BIS_DEBUG_LOG_DIRECTORY is not set up
26    ------------------------------------------------------
27    l_dir:='/sqlcom/log';
28 
29    ----------------------------------------------------------------
30    -- fii_util.initialize will get profile options FII_DEBUG_MODE
31    -- and BIS_DEBUG_LOG_DIRECTORY and set up the directory where
32    -- the log files and output files are written to
33    ----------------------------------------------------------------
34   	FII_UTIL.initialize('FII_AP_MV_REFRESH.log', 'FII_AP_MV_REFRESH.out',l_dir);
35 
36 
37 	  g_phase := 'Refreshing AP MV tables - 1';
38    if g_debug_flag = 'Y' then
39    	FII_UTIL.put_line(g_phase);
40    	FII_UTIL.put_line('');
41    end if;
42 
43    l_parallel_degree :=  BIS_COMMON_PARAMETERS.GET_DEGREE_OF_PARALLELISM();
44    IF  (l_parallel_degree =1) THEN
45        l_parallel_degree := 0;
46    END IF;
47 
48    dbms_mview.refresh(
49 			list => 'FII_AP_HHIST_B_MV,FII_AP_LIA_B_MV,FII_AP_HCAT_B_MV,FII_AP_IVATY_B_MV,
50                      FII_AP_PAID_XB_MV,FII_AP_PAYOL_XB_MV,FII_AP_LIWAG_IB_MV',
51 			method => '???????',
52 			parallelism => l_parallel_degree
53 	);
54 
55 	  g_phase := 'Refreshing AP MV tables - 2';
56    if g_debug_flag = 'Y' then
57    	FII_UTIL.put_line(g_phase);
58    	FII_UTIL.put_line('');
59    end if;
60 
61    dbms_mview.refresh(
62 			list => 'FII_AP_HHIST_I_MV,FII_AP_LIA_I_MV,FII_AP_HCAT_I_MV,FII_AP_IVATY_XB_MV',
63 			method => '????',
64 			parallelism => l_parallel_degree
65 	);
66 
67 	  g_phase := 'Refreshing AP MV tables - 3';
68    if g_debug_flag = 'Y' then
69    	FII_UTIL.put_line(g_phase);
70    	FII_UTIL.put_line('');
71    end if;
72 
73    dbms_mview.refresh(
74 			list => 'FII_AP_HHIST_IB_MV,FII_AP_LIA_IB_MV,FII_AP_HCAT_IB_MV',
75 			method => '???',
76 			parallelism => l_parallel_degree
77 	);
78 
79 	  g_phase := 'Refreshing AP MV tables - 4';
80    if g_debug_flag = 'Y' then
81    	FII_UTIL.put_line(g_phase);
82    	FII_UTIL.put_line('');
83    end if;
84 
85    dbms_mview.refresh(
86 			list => 'FII_AP_HATY_XB_MV,FII_AP_HLIA_IB_MV',
87 			method => '??',
88 			parallelism => l_parallel_degree
89 	);
90 
91 	  g_phase := 'Refreshing AP MV tables - 5';
92    if g_debug_flag = 'Y' then
93    	FII_UTIL.put_line(g_phase);
94    	FII_UTIL.put_line('');
95    end if;
96 
97    dbms_mview.refresh(
98 			list => 'FII_AP_HLIA_I_MV,FII_AP_HLWAG_IB_MV',
99 			method => '??',
100 			parallelism => l_parallel_degree
101 	);
102 
103 EXCEPTION
104 	WHEN OTHERS THEN
105  		Errbuf:= sqlerrm;
106  		Retcode:=sqlcode;
107  		if g_debug_flag = 'Y' then
108 			FII_UTIL.DEBUG_LINE(Retcode||':'||Errbuf);
109 		end if;
110 
111 END AP_REFRESH;
112 
113 END FII_AP_MV_REFRESH;