[Home] [Help]
PACKAGE BODY: APPS.EDW_PROJ_PKG
Source
1 PACKAGE BODY EDW_PROJ_PKG AS
2 /* $Header: FIICAPJB.pls 120.0 2002/08/24 04:50:07 appldev noship $ */
3
4
5 -- ----------------------
6 -- function PROJECT_FK
7 -- ----------------------
8
9 function project_fk(p_project_id in NUMBER,
10 p_instance_code in VARCHAR2 := NULL)
11 return varchar2 is
12 x_instance varchar2(40);
13 begin
14
15 if p_project_id IS NULL then
16 return 'NA_EDW';
17 end if;
18
19 if p_instance_code IS NULL then
20 x_instance := edw_instance.get_code;
21 else
22 x_instance := p_instance_code;
23 end if;
24
25 return p_project_id || '-' || x_instance || '-PJ-PRJ';
26
27 end Project_fk;
28
29 -- ----------------------------
30 -- function SEIBAN_NUMBER_FK
31 -- ----------------------------
32
33 function seiban_number_fk(p_project_id in NUMBER,
34 p_instance_code in VARCHAR2 := NULL)
35 return varchar2 is
36 x_instance varchar2(40);
37 begin
38
39 if p_project_id IS NULL then
40 return 'NA_EDW';
41 end if;
42
43 if p_instance_code IS NULL then
44 x_instance := edw_instance.get_code;
45 else
46 x_instance := p_instance_code;
47 end if;
48
49 return p_project_id || '-' || x_instance || '-SB-PRJ';
50
51 end seiban_number_fk;
52
53 -- ----------------------
54 -- function TASK_FK
55 -- ----------------------
56
57 Function task_fk( p_task_id in NUMBER,
58 p_project_id in NUMBER := NULL,
59 p_instance_code in VARCHAR2 := NULL)
60 return VARCHAR2 IS
61
62 x_instance varchar2(40);
63
64 BEGIN
65
66 if p_task_id IS NULL then
67 return 'NA_EDW';
68 end if;
69
70 if p_instance_code IS NULL then
71 x_instance := edw_instance.get_code;
72 else
73 x_instance := p_instance_code;
74 end if;
75
76 return p_task_id || '-' || x_instance;
77
78 END Task_fk;
79
80 -- ----------------------
81 -- function TOP_TASK_FK
82 -- ----------------------
83
84
85 Function top_task_fk(p_task_id in NUMBER,
86 p_project_id in NUMBER := NULL,
87 p_instance_code in VARCHAR2 := NULL)
88 return VARCHAR2 IS
89
90 x_instance varchar2(40);
91
92 BEGIN
93
94 if p_task_id IS NULL then
95 return 'NA_EDW';
96 end if;
97
98 if p_instance_code IS NULL then
99 x_instance := edw_instance.get_code;
100 else
101 x_instance := p_instance_code;
102 end if;
103
104 return p_task_id || '-' || x_instance;
105
106 END top_task_fk;
107
108 end;