DBA Data[Home] [Help]

PACKAGE BODY: APPS.OZF_COMMON_PARAMETERS_PVT

Source


1 PACKAGE BODY ozf_common_parameters_pvt AS
2 /* $Header: ozfvcomb.pls 115.1 2003/11/04 19:40:30 mkothari noship $  */
3    VERSION  CONSTANT VARCHAR (80) := '$Header: ozfvcomb.pls 115.1 2003/11/04 19:40:30 mkothari noship $';
4 
5 
6 FUNCTION GET_PERIOD_SET_NAME RETURN VARCHAR2 IS
7   l_period_set_name varchar2(15);
8 BEGIN
9 -- l_period_set_name:='Accounting';
10 
11    l_period_set_name:=fnd_profile.value('AMS_CAMPAIGN_DEFAULT_CALENDER');
12    return l_period_set_name;
13 EXCEPTION
14     when no_data_found then
15         return null;
16     when others then
17         raise;
18 END;
19 
20 
21 
22 FUNCTION GET_START_DAY_OF_WEEK_ID  RETURN VARCHAR2 IS
23  l_start_dayofweek varchar2(30);
24 BEGIN
25 --     l_start_dayofweek:='2';
26 
27      l_start_dayofweek:=fnd_profile.value('OZF_TP_START_DAY_OF_WEEK');
28      return l_start_dayofweek;
29 EXCEPTION
30     when no_data_found then
31         return null;
32     when others then
33         raise;
34 END;
35 
36 
37 FUNCTION GET_PERIOD_TYPE  RETURN VARCHAR2 IS
38  l_period_type  varchar2(15);
39 BEGIN
40 --    l_period_type:='Month';
41     l_period_type:=fnd_profile.value('OZF_TP_PERIOD_TYPE');
42     return l_period_type;
43 EXCEPTION
44     when no_data_found then
45         return null;
46     when others then
47         raise;
48 END;
49 
50 
51 FUNCTION GET_GLOBAL_START_DATE   RETURN DATE IS
52 l_global_start_date varchar2(30);
53 BEGIN
54      l_global_start_date:=fnd_profile.value('OZF_TP_GLOBAL_START_DATE');
55      return to_date(l_global_start_date, 'mm/dd/yyyy');
56 EXCEPTION
57     when no_data_found then
58         return null;
59     when others then
60         raise;
61 END;
62 
63 
64 FUNCTION CHECK_GLOBAL_PARAMETERS(
65   p_parameter_list       IN DBMS_SQL.VARCHAR2_TABLE)
66   RETURN BOOLEAN IS
67 
68   l_count number := 0;
69   l_profile_list varchar2(3000) := '';
70   l_new_line  varchar2(10):='
71 ';
72   l_return_value boolean := true;
73   l_profile_name varchar2(100);
74 
75 BEGIN
76 
77 	l_return_value := true;
78 	l_profile_list := null;
79 	IF (p_parameter_list.count = 0) THEN
80 		return true;
81 	END IF;
82 
83 	l_count := p_parameter_list.first;
84 
85 	LOOP
86 
87 	  l_profile_name := p_parameter_list(l_count);
88 
89 	  IF (fnd_profile.value(l_profile_name) IS NULL) THEN
90 		l_profile_list := l_profile_list || l_profile_name;
91 		l_return_value := false;
92 	  END IF;
93 
94 	  EXIT WHEN l_count = p_parameter_list.last;
95 	  l_count := p_parameter_list.next(l_count);
96 
97 	END LOOP;
98 
99 	IF (l_return_value) THEN
100 		null;
101 	ELSE
102            fnd_message.set_name('OZF', 'OZF_TP_PROFILE_NOT_SET');
103            fnd_message.set_token('PROFILE', l_profile_list);
104 	   OZF_TP_UTIL_PVT.put_line(fnd_message.get);
105 	END IF;
106 
107 	return l_return_value;
108 END;
109 
110 
111 
112 FUNCTION get_degree_of_parallelism RETURN NUMBER IS
113 l_parallel number;
114 BEGIN
115 
116 	l_parallel := null;
117         l_parallel := floor(fnd_profile.value('OZF_TP_PARALLEL_SRC'));
118 
119 
120           /* If set by the customer, return this value */
121 
122 	  IF (l_parallel IS NOT NULL and l_parallel > 0) THEN
123  		return l_parallel;
124 	  END IF;
125 
126 
127 	  /* If Not set by customer, so query v$pq_sysstat */
128 	  BEGIN
129 
130 	  SELECT value INTO l_parallel
131 	  FROM v$pq_sysstat WHERE trim(statistic) = 'Servers Idle';
132 
133 	  EXCEPTION when no_data_found then
134 			l_parallel := 1;
135 	  END;
136 
137 	  IF (l_parallel IS NULL) THEN
138 		l_parallel:=1;
139 	  END IF;
140 
141 	  l_parallel := floor(l_parallel/2);
142 	  IF (l_parallel = 0) THEN
143 		l_parallel := 1;
144 	  END IF;
145 
146 	  return l_parallel;
147 
148 END;
149 
150 
151 END ozf_common_parameters_pvt;