1 PACKAGE MSD_DEM_DEMANTRA_UTILITIES AS
2 /* $Header: msddemdus.pls 120.0.12010000.2 2008/05/07 11:00:29 sjagathe ship $ */
3
4
5
6 /*** CONSTANTS - BEGIN ***/
7
8 /*** CONSTANTS - END ***/
9
10
11
12
13 /*** PUBLIC PROCEDURES - BEGIN ***
14 * LOG_MESSAGE
15 * LOG_DEBUG
16 */
17
18
19 /* DUMMY PROCEDURE
20 * This procedure logs a given message text in ???
21 * param: p_buff - message text to be logged.
22 */
23 PROCEDURE LOG_MESSAGE ( p_buff IN VARCHAR2);
24
25
26 /* DUMMY PROCEDURE
27 * This procedure logs a given debug message text in ???
28 * only if the profile MSD_DEM_DEBUG is set to 'Yes'.
29 * param: p_buff - debug message text to be logged.
30 */
31 PROCEDURE LOG_DEBUG ( p_buff IN VARCHAR2);
32
33
34
35 /*** PUBLIC PROCEDURES - END ***/
36
37
38
39
40 /*** PUBLIC FUNCTIONS - BEGIN ***
41 * GET_SEQUENCE_NEXTVAL
42 * CREATE_SERIES
43 * DELETE_SERIES
44 * ADD_SERIES_TO_COMPONENT
45 * CREATE_INTEGRATION_INTERFACE
46 * DELETE_INTEGRATION_INTERFACE
47 * CREATE_DATA_PROFILE
48 * ADD_SERIES_TO_PROFILE
49 * ADD_LEVEL_TO_PROFILE
50 * CREATE_WORKFLOW_SCHEMA
51 * DELETE_WORKFLOW_SCHEMA
52 * GET_DEMANTRA_SCHEMA
53 * CREATE_DEMANTRA_DB_OBJECT
54 * DROP_DEMANTRA_DB_OBJECT
55 * CREATE_SYNONYM_IN_EBS
56 */
57
58
59 /*
60 * This function calls the GET_SEQ_NEXTVAL procedure in the Demantra schema.
61 * The function returns -
62 * n : next value for the given sequence
63 * -1 : If table is not present
64 * -2 : If column is not present
65 * -3 : Any other error
66 */
67 FUNCTION GET_SEQUENCE_NEXTVAL (
68 p_table_name IN VARCHAR2,
69 p_column_name IN VARCHAR2,
70 p_seq_name IN VARCHAR2)
71 RETURN NUMBER;
72
73
74 /*
75 * This function creates the series given in Demantra schema.
76 * The function returns -
77 * n : The series id in case of success
78 * -1 : in case of error
79 * -3 : Unable to set demantra schema name
80 * -4 : Some of the mandatory parameters are NULL.
81 * -5 : Unable to get next sequence value for forecast type id
82 * -6 : Column already present in the table
83 */
84 FUNCTION CREATE_SERIES (
85 p_computed_name IN VARCHAR2,
86 p_exp_template IN VARCHAR2,
87 p_computed_title IN VARCHAR2,
88 p_sum_func IN VARCHAR2,
89 p_scaleble IN NUMBER,
90 p_editable IN NUMBER,
91 p_is_proportion IN NUMBER,
92 p_dbname IN VARCHAR2,
93 p_hint_message IN VARCHAR2,
94 p_hist_pred_type IN NUMBER,
95 p_data_table_name IN VARCHAR2,
96 p_prop_calc_series IN NUMBER,
97 p_base_level IN NUMBER,
98 p_expression_type IN NUMBER,
99 p_int_aggr_func IN VARCHAR2,
100 p_aggr_by IN NUMBER,
101 p_preservation_type IN NUMBER,
102 p_move_preservation_type IN NUMBER,
103 p_data_type IN NUMBER)
104 RETURN NUMBER;
105
106
107 /*
108 * This function deletes the series given in Demantra Schema.
109 * The function returns -
110 * n : The series id in case of success
111 * -1 : in case of error
112 * -2 : if series is not present
113 * -3 : Unable to set demantra schema name
114 */
115 FUNCTION DELETE_SERIES ( p_computed_name IN VARCHAR2 )
116 RETURN NUMBER;
117
118
119 /*
120 * This function adds the given series to the given component and also
121 * to the user who owns the component.
122 * The function returns -
123 * 0 : In case of success
124 * -1 : in case of error
125 * -3 : Unable to set demantra schema name
126 */
127 FUNCTION ADD_SERIES_TO_COMPONENT (
128 p_series_id IN NUMBER,
129 p_component_id IN NUMBER)
130 RETURN NUMBER;
131
132
133 /*
134 * This function creates an integration interface given name and description
135 * the the owning user.
136 * The function returns -
137 * n : integration interface id
138 * -1 : in case of error
139 * -3 : Unable to set demantra schema name
140 * -4 : If an integration interface with the same name already exists
141 * -5 : Unable to get next sequence value for integration interface id
142 */
143 FUNCTION CREATE_INTEGRATION_INTERFACE (
144 p_name IN VARCHAR2,
145 p_description IN VARCHAR2,
146 p_user_id IN NUMBER)
147 RETURN NUMBER;
148
149
150 /*
151 * This function creates an integration interface given name and description
152 * the the owning user.
153 * The function returns -
154 * 0 : in case of success (includes absence of the given integration interface name)
155 * -1 : in case of error
156 * -3 : Unable to set demantra schema name
157 */
158 FUNCTION DELETE_INTEGRATION_INTERFACE (p_name IN VARCHAR2)
159 RETURN NUMBER;
160
161
162 /*
163 * This function creates a data profile
164 * The function returns -
165 * n : the data profile id
166 * -1 : in case of error
167 * -3 : Unable to set demantra schema name
168 */
169 FUNCTION CREATE_DATA_PROFILE (
170 p_transfer_id IN NUMBER,
171 p_view_name IN VARCHAR2,
172 p_table_name IN VARCHAR2,
173 p_view_type IN NUMBER,
174 p_use_real_proportion IN NUMBER,
175 p_insertnewcombinations IN NUMBER,
176 p_insertforecasthorizon IN NUMBER,
177 p_query_name IN VARCHAR2,
178 p_description IN VARCHAR2,
179 p_time_res_id IN NUMBER,
180 p_from_date IN DATE,
181 p_until_date IN DATE,
182 p_relative_date IN NUMBER,
183 p_relative_from_date IN NUMBER,
184 p_relative_until_date IN NUMBER,
185 p_integration_type IN NUMBER,
186 p_export_type IN NUMBER,
187 p_base_level_id IN NUMBER)
188 RETURN NUMBER;
189
190
191 /*
192 * This function adds the given series to the data profile.
193 * The function returns -
194 * 0 : in case of success
195 * -1 : in case of error
196 * -3 : Unable to set demantra schema name
197 */
198 FUNCTION ADD_SERIES_TO_PROFILE (
199 p_data_profile_id IN NUMBER,
200 p_series_id IN NUMBER )
201 RETURN NUMBER;
202
203
204 /*
205 * This function adds the given level to the data profile.
206 * The function returns -
207 * 0 : in case of success
208 * -1 : in case of error
209 * -3 : Unable to set demantra schema name
210 */
211 FUNCTION ADD_LEVEL_TO_PROFILE (
212 p_data_profile_id IN NUMBER,
213 p_level_id IN NUMBER,
214 p_lorder IN NUMBER )
215 RETURN NUMBER;
216
217
218 /*
219 * This function creates the given workflow schema.
220 * The function returns -
221 * n : the schema id
222 * -1 : in case of error
223 * -3 : Unable to set demantra schema name
224 */
225 FUNCTION CREATE_WORKFLOW_SCHEMA (
226 p_schema_name IN VARCHAR2,
227 p_schema_data IN VARCHAR2,
228 p_owner_id IN NUMBER,
229 p_creation_date IN DATE,
230 p_modified_date IN DATE,
231 p_schema_type IN NUMBER )
232 RETURN NUMBER;
233
234
235 /*
236 * This function deletes the workflow schema given.
237 * The function returns -
238 * 0 : in case of success
239 * -1 : in case of error
240 * -3 : Unable to set demantra schema name
241 */
242 FUNCTION DELETE_WORKFLOW_SCHEMA ( p_schema_name IN VARCHAR2 )
243 RETURN NUMBER;
244
245
246 /*
247 * This function gets the demantra schema name.
248 * The function returns -
249 * <demantra schema name> : if demantra is installed.
250 * null : if demantra is not installed.
251 */
252 FUNCTION GET_DEMANTRA_SCHEMA
253 RETURN VARCHAR2;
254
255
256 /*
257 * This function creates the given db object.
258 * The function returns -
259 * 0 : in case of success
260 * -1 : in case of error
261 * -3 : Unable to set demantra schema name
262 */
263 FUNCTION CREATE_DEMANTRA_DB_OBJECT (
264 p_object_type IN VARCHAR2,
265 p_object_name IN VARCHAR2,
266 p_create_sql IN VARCHAR2)
267 RETURN NUMBER;
268
269
270 /*
271 * This function drop the given demantra db object.
272 * The function returns -
273 * 0 : in case of success/object not present
274 * -1 : in case of error
275 * -3 : Unable to set demantra schema name
276 */
277 FUNCTION DROP_DEMANTRA_DB_OBJECT (
278 p_object_type IN VARCHAR2,
279 p_object_name IN VARCHAR2 )
280 RETURN NUMBER;
281
282
283 /*
284 * This function work only if Demantra and APS are on the same DB instance.
285 * This function creates a synonym in the APPS schema using the given sql
286 * script.
287 * The function returns -
288 * 0 : in case of success
289 * -1 : in case of error
290 * -3 : Unable to set demantra schema name
291 */
292 FUNCTION CREATE_SYNONYM_IN_EBS (
293 p_object_name IN VARCHAR2,
294 p_create_replace_sql IN VARCHAR2)
295 RETURN NUMBER;
296
297
298
299
300 /*** PUBLIC FUNCTIONS - END ***/
301
302
303
304
305
306 END MSD_DEM_DEMANTRA_UTILITIES;