DBA Data[Home] [Help]

PACKAGE BODY: APPS.ISC_DBI_PLAN_PARAM_PKG

Source


1 PACKAGE BODY ISC_DBI_PLAN_PARAM_PKG AS
2 /* $Header: ISCRGAGB.pls 120.0 2005/05/25 17:33:40 appldev noship $ */
3 
4 ---------------------
5 -- FUNCTION: get_plan
6 -- This function will return the plan snapshot id of the first row after 'NA'(None Plan). The view is already
7 -- sorted by plan run date and plan name.
8 ---------------------
9 
10 FUNCTION get_plan RETURN NUMBER IS
11 
12    stmt 	       NUMBER;
13 
14 BEGIN
15 	select id into stmt from isc_plan_snapshot_v where id<>-1 and rownum<2;
16 	RETURN stmt;
17 
18 END get_plan;
19 
20 
21 ----------------------------
22 -- Function: get_plan_currency
23 -- This function returns the DBI Global currency code
24 ----------------------------
25 
26 FUNCTION get_plan_currency RETURN VARCHAR2 IS
27 
28    stmt 	       VARCHAR2(20);
29 
30 
31 BEGIN
32 
33 	RETURN 'FII_GLOBAL1';
34 
35 END get_plan_currency;
36 
37 ----------------------------
38 -- Function: get_plan_period
39 -- This function returns the current period
40 ----------------------------
41 
42 FUNCTION get_plan_period RETURN NUMBER IS
43 
44    stmt 	       NUMBER;
45 
46 
47 BEGIN
48 
49 	select ent_period_id into stmt from fii_time_ent_period where sysdate between start_date and end_date;
50 
51 	RETURN stmt;
52 
53 END get_plan_period;
54 
55 ----------------------
56 -- Function: a
57 -- This function returns the earliest data start date of all plans.
58 ---------------------
59 
60 FUNCTION a RETURN DATE IS
61 
62   l_return_date date;
63 
64 BEGIN
65 
66   	select min(data_start_date) into l_return_date from isc_dbi_plan_snapshots;
67 
68   	RETURN l_return_date;
69 
70 END a;
71 
72 -----------------
73 -- Function: b
74 -- This function returns the latest data end date of all plans.
75 ------------------
76 
77 FUNCTION b RETURN DATE IS
78 
79   l_return_date DATE;
80 
81 BEGIN
82 
83   select max(cutoff_date) into l_return_date from isc_dbi_plan_snapshots;
84 
85   RETURN l_return_date;
86 
87 END b;
88 
89 
90 --------------------------------
91 -- Function: get_page_params
92 -- This function returns all default parameter value for Plan
93 -- Mgmt page parameter portlet.
94 ---------------------------------
95 FUNCTION get_page_params RETURN VARCHAR2 IS
96 
97   l_plan	NUMBER;
98   l_currency	VARCHAR(20);
99   l_cur_period  NUMBER;
100 
101   BEGIN
102 	l_plan:= ISC_DBI_PLAN_PARAM_PKG.get_plan;
103 	select ent_period_id into l_cur_period from fii_time_ent_period where trunc(sysdate) between start_date and end_date;
104 
105 	RETURN '&PLAN_SNAPSHOT='||l_plan||
106 		'&PLAN_SNAPSHOT_2=-1'||
107 		'&TIME+FII_TIME_ENT_PERIOD_FROM='||l_cur_period||'&TIME+FII_TIME_ENT_PERIOD_TO='||l_cur_period||
108 		'&ORGANIZAT_D1=All'||
109 		'&FII_CURRENCIES=FII_GLOBAL1';
110 
111 
112 END get_page_params;
113 
114 
115 
116 END ISC_DBI_PLAN_PARAM_PKG ;
117