DBA Data[Home] [Help]

PACKAGE BODY: APPS.FEM_BR_DATA_INSPECTOR_PVT

Source


1 PACKAGE BODY FEM_BR_DATA_INSPECTOR_PVT AS
2 /* $Header: FEMVDIB.pls 120.0 2005/06/06 19:50:15 appldev noship $ */
3 
4 --------------------------------------------------------------------------------
5 -- PRIVATE CONSTANTS
6 --------------------------------------------------------------------------------
7 
8 G_PKG_NAME constant varchar2(30) := 'FEM_BR_DATA_INSPECTOR_PVT';
9 
10 --------------------------------------------------------------------------------
11 -- PRIVATE SPECIFICATIONS
12 --------------------------------------------------------------------------------
13 
14 PROCEDURE DeleteDataInspector(
15   p_obj_def_id in number
16 );
17 
18 PROCEDURE DeleteDataInspectorCols(
19   p_obj_def_id in number
20 );
21 
22 PROCEDURE CopyDataInspector(
23   p_source_obj_def_id in number
24   ,p_target_obj_def_id in number
25   ,p_created_by         in          number
26   ,p_creation_date      in          date
27 );
28 
29 PROCEDURE CopyDataInspectorCols(
30   p_source_obj_def_id in number
31   ,p_target_obj_def_id in number
32   ,p_created_by         in          number
33   ,p_creation_date      in          date
34 );
35 
36 --------------------------------------------------------------------------------
37 -- PUBLIC BODIES
38 --------------------------------------------------------------------------------
39 
40 --
41 -- PROCEDURE
42 --	 DeleteObjectDefinition
43 --
44 -- DESCRIPTION
45 --   Deletes all the details records of a Data Inspector Rule Definition.
46 --
47 -- IN
48 --   p_obj_def_id    - Object Definition ID.
49 --
50 --------------------------------------------------------------------------------
51 PROCEDURE DeleteObjectDefinition(
52   p_obj_def_id          in          number
53 )
54 --------------------------------------------------------------------------------
55 IS
56 
57   g_api_name    constant varchar2(30)   := 'DeleteObjectDefinition';
58 
59 BEGIN
60 
61   DeleteDataInspector(
62     p_obj_def_id     => p_obj_def_id
63   );
64 
65   DeleteDataInspectorCols(
66     p_obj_def_id     => p_obj_def_id
67   );
68 
69 EXCEPTION
70 
71   when others then
72     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
73     raise FND_API.G_EXC_UNEXPECTED_ERROR;
74 
75 END DeleteObjectDefinition;
76 
77 
78 --
79 -- PROCEDURE
80 --	 CopyObjectDefinition
81 --
82 -- DESCRIPTION
83 --   Creates all the detail records of a new Data Inspector Rule Definition (target)
84 --   by copying the detail records of another Data Inspector Rule Definition (source).
85 --
86 -- IN
87 --   p_source_obj_def_id    - Source Object Definition ID.
88 --   p_target_obj_def_id    - Target Object Definition ID.
89 --   p_created_by           - FND User ID (optional).
90 --   p_creation_date        - System Date (optional).
91 --
92 --------------------------------------------------------------------------------
93 PROCEDURE CopyObjectDefinition(
94   p_source_obj_def_id   in          number
95   ,p_target_obj_def_id  in          number
96   ,p_created_by         in          number
97   ,p_creation_date      in          date
98 )
99 --------------------------------------------------------------------------------
100 IS
101 
102   g_api_name    constant varchar2(30)   := 'CopyObjectDefinition';
103 
104 BEGIN
105 
106   CopyDataInspector(
107     p_source_obj_def_id     => p_source_obj_def_id
108     ,p_target_obj_def_id    => p_target_obj_def_id
109     ,p_created_by         => p_created_by
110     ,p_creation_date      => p_creation_date
111   );
112 
113   CopyDataInspectorCols(
114     p_source_obj_def_id     => p_source_obj_def_id
115     ,p_target_obj_def_id    => p_target_obj_def_id
116     ,p_created_by         => p_created_by
117     ,p_creation_date      => p_creation_date
118   );
119 
120 EXCEPTION
121 
122   when others then
123     FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, g_api_name);
124     raise FND_API.G_EXC_UNEXPECTED_ERROR;
125 
126 END CopyObjectDefinition;
127 
128 
129 
130 --------------------------------------------------------------------------------
131 -- PRIVATE BODIES
132 --------------------------------------------------------------------------------
133 
134 --
135 -- PROCEDURE
136 --	 DeleteDataInspector
137 --
138 -- DESCRIPTION
139 --   Deletes a Data Inspector Rule Definition by performing deletes on records
140 --   in the FEM_DATA_INSPECTORS table.
141 --
142 -- IN
143 --   p_obj_def_id    - Object Definition ID.
144 --
145 --------------------------------------------------------------------------------
146 PROCEDURE DeleteDataInspector(
147   p_obj_def_id in number
148 )
149 --------------------------------------------------------------------------------
150 IS
151 BEGIN
152 
153   delete from fem_data_inspectors
154   where data_inspector_obj_def_id = p_obj_def_id;
155 
156 END DeleteDataInspector;
157 
158 
159 --
160 -- PROCEDURE
161 --	 DeleteDataInspectorCols
162 --
163 -- DESCRIPTION
164 --   Deletes a Data Inspector Rule Definition by performing deletes on records
165 --   in the FEM_DATA_INSPECTOR_COLS table.
166 --
167 -- IN
168 --   p_obj_def_id    - Object Definition ID.
169 --
170 --------------------------------------------------------------------------------
171 PROCEDURE DeleteDataInspectorCols(
172   p_obj_def_id in number
173 )
174 --------------------------------------------------------------------------------
175 IS
176 BEGIN
177 
178   delete from fem_data_inspector_cols
179   where data_inspector_obj_def_id = p_obj_def_id;
180 
181 END DeleteDataInspectorCols;
182 
183 
184 --
185 -- PROCEDURE
186 --	 CopyDataInspector
187 --
188 -- DESCRIPTION
189 --   Creates a new Data Inspector Rule Definition by copying records in the
190 --   FEM_DATA_INSPECTORS table.
191 --
192 -- IN
193 --   p_source_obj_def_id    - Source Object Definition ID.
194 --   p_target_obj_def_id    - Target Object Definition ID.
195 --   p_created_by           - FND User ID (optional).
196 --   p_creation_date        - System Date (optional).
197 --
198 --------------------------------------------------------------------------------
199 PROCEDURE CopyDataInspector(
200   p_source_obj_def_id in number
201   ,p_target_obj_def_id in number
202   ,p_created_by         in          number
203   ,p_creation_date      in          date
204 )
205 --------------------------------------------------------------------------------
206 IS
207 BEGIN
208 
209   insert into fem_data_inspectors(
210     data_inspector_obj_def_id
211     ,table_name
212     ,num_rows
213     ,condition_obj_id
214     ,created_by
215     ,creation_date
216     ,last_updated_by
217     ,last_update_date
218     ,last_update_login
219     ,object_version_number
220   ) select
221     p_target_obj_def_id
222     ,table_name
223     ,num_rows
224     ,condition_obj_id
225     ,nvl(p_created_by,FND_GLOBAL.user_id)
226     ,nvl(p_creation_date,sysdate)
227     ,FND_GLOBAL.user_id
228     ,sysdate
229     ,FND_GLOBAL.login_id
230     ,1
231   from fem_data_inspectors
232   where data_inspector_obj_def_id = p_source_obj_def_id;
233 
234 END CopyDataInspector;
235 
236 
237 
238 --
239 -- PROCEDURE
240 --	 CopyDataInspectorCols
241 --
242 -- DESCRIPTION
243 --   Creates a new Data Inspector Rule Definition by copying records in the
244 --   FEM_DATA_INSPECTOR_COLS table.
245 --
246 -- IN
247 --   p_source_obj_def_id    - Source Object Definition ID.
248 --   p_target_obj_def_id    - Target Object Definition ID.
249 --   p_created_by           - FND User ID (optional).
250 --   p_creation_date        - System Date (optional).
251 --
252 --------------------------------------------------------------------------------
253 PROCEDURE CopyDataInspectorCols(
254   p_source_obj_def_id in number
255   ,p_target_obj_def_id in number
256   ,p_created_by         in          number
257   ,p_creation_date      in          date
258 )
259 --------------------------------------------------------------------------------
260 IS
261 BEGIN
262 
263   insert into fem_data_inspector_cols(
264     data_inspector_obj_def_id
265     ,table_name
266     ,column_name
267     ,display_sequence
268     ,editable_flag
269     ,sort_sequence
270     ,sort_direction_flag
271     ,created_by
272     ,creation_date
273     ,last_updated_by
274     ,last_update_date
275     ,last_update_login
276     ,object_version_number
277   ) select
278     p_target_obj_def_id
279     ,table_name
280     ,column_name
281     ,display_sequence
282     ,editable_flag
283     ,sort_sequence
284     ,sort_direction_flag
285     ,nvl(p_created_by,FND_GLOBAL.user_id)
286     ,nvl(p_creation_date,sysdate)
287     ,FND_GLOBAL.user_id
288     ,sysdate
289     ,FND_GLOBAL.login_id
290     ,1
291   from fem_data_inspector_cols
292   where data_inspector_obj_def_id = p_source_obj_def_id;
293 
294 END CopyDataInspectorCols;
295 
296 
297 
298 END FEM_BR_DATA_INSPECTOR_PVT;