DBA Data[Home] [Help]

PACKAGE: APPS.BSC_APPS

Source


1 PACKAGE BSC_APPS AS
2 /* $Header: BSCAPPSS.pls 120.1 2006/02/14 13:09:25 meastmon noship $ */
3 /*===========================================================================+
4 |               Copyright (c) 1999 Oracle Corporation                        |
5 |                  Redwood Shores, California, USA                           |
6 |                       All rights reserved                                  |
7 |============================================================================|
8 |
9 |   Name:          BSCAPPSS.pls
10 |
11 |   Description:   This package contains procedures to perform APPS
12 |                  related calls by all BSC modules.
13 |
14 |                  This package have to be installed in both Enterprise and
15 |                  Personal versions od BSC.
16 |
17 |                  For Personal version, this package requires the following
18 |                  dummy packages:
19 |                  - FND_INSTALLATION (files: BSCFNDIS.pls and BSCFNDIB.pls)
20 |                  - AD_DDL (files: BSCADDDS.pls and BSCADDDB.pls)
21 |
22 |                  Before you can call any other procedure in this package, you
23 |                  have to call the procedure INIT_BSC_APPS of this package.
24 |                  This procedure initializes some global variables for example
25 |                  one variable that indicates the enviroment on which you are
26 |                  (APPS or Personal)
27 |
28 |   Example:
29 |
30 |   Security:
31 |
32 |   History:       Created By: Mauricio Eastmond            Date: 04-JAN-00
33 |
34 |   Srini Jandyala 27-Feb-02   Added Get_Lookup_Value() procedure for HTML UI
35 |          20-Aug-03   Adeulgao fixed bug#3008243 added 2 functions
36 |                      (overloaded) get_user_schema to get the schema name
37 |
38 |          19-APR-2004 PAJOHRI  Bug #3541933, added a overloaded function     |
39 |                               Do_DDL_AT                                     |
40 +============================================================================*/
41 
42 TYPE Autonomous_Statements IS Record
43 (       x_Fnd_Apps_Schema         VARCHAR2(30)
44     ,   x_Bsc_Apps_Short_Name     VARCHAR2(30)
45     ,   x_Statement               VARCHAR2(8000)
46     ,   x_Object_Name             VARCHAR2(100)
47     ,   x_Statement_Type          INTEGER
48 );
49 --==============================================================
50 TYPE Autonomous_Statements_Tbl_Type IS TABLE OF Autonomous_Statements INDEX BY BINARY_INTEGER;
51 
52 
53 -- Global variables
54     TYPE t_ddl_stmt_rec IS RECORD (
55         sql_stmt VARCHAR2(32700):= NULL,
56         stmt_type INTEGER := 0,
57         object_name VARCHAR2(100) := NULL
58     );
59 
60     TYPE t_array_ddl_stmts IS TABLE OF t_ddl_stmt_rec INDEX BY BINARY_INTEGER;
61 
62     LOG_FILE    NUMBER := 0;    -- Log file
63     OUTPUT_FILE NUMBER := 1;    -- Output file. Only make sense in APPS environment
64                         -- In Personal, It always write in the log file.
65 
66     apps_env BOOLEAN := FALSE;
67     bsc_apps_short_name VARCHAR2(30) := NULL;
68     bsc_apps_schema VARCHAR2(30) := NULL;
69     fnd_apps_short_name VARCHAR2(30) := NULL;
70     fnd_apps_schema VARCHAR2(30) := NULL;
71     bsc_appl_id NUMBER;
72     apps_user_id NUMBER;
73     bsc_mv BOOLEAN := FALSE;
74 
75     bsc_storage_clause VARCHAR2(250) := ' '; -- Storage clause used when creating tables and indexes
76     bsc_tablespace_clause_tbl VARCHAR2(250) := ' '; -- Tablespace clause used when creating tables
77     bsc_tablespace_clause_idx VARCHAR2(250) := ' '; -- Tablespace clause used when creating indexes
78 
79     fnd_global_user_id NUMBER := FND_GLOBAL.USER_ID;
80 
81     -- Tablespace types
82     dimension_table_tbs_type VARCHAR2(20) := 'DIMENSION_TABLE';
83     dimension_index_tbs_type VARCHAR2(20) := 'DIMENSION_INDEX';
84     input_table_tbs_type     VARCHAR2(20) := 'INPUT_TABLE';
85     input_index_tbs_type     VARCHAR2(20) := 'INPUT_INDEX';
86     base_table_tbs_type      VARCHAR2(20) := 'BASE_TABLE';
87     base_index_tbs_type      VARCHAR2(20) := 'BASE_INDEX';
88     summary_table_tbs_type   VARCHAR2(20) := 'SUMMARY_TABLE';
89     summary_index_tbs_type   VARCHAR2(20) := 'SUMMARY_INDEX';
90     other_table_tbs_type     VARCHAR2(20) := 'OTHER_TABLE';
91     other_index_tbs_type     VARCHAR2(20) := 'OTHER_INDEX';
92 
93     -- Tablespace names
94     dimension_table_tbs_name VARCHAR2(80) := NULL;
95     dimension_index_tbs_name VARCHAR2(80) := NULL;
96     input_table_tbs_name     VARCHAR2(80) := NULL;
97     input_index_tbs_name     VARCHAR2(80) := NULL;
98     base_table_tbs_name      VARCHAR2(80) := NULL;
99     base_index_tbs_name      VARCHAR2(80) := NULL;
100     summary_table_tbs_name   VARCHAR2(80) := NULL;
101     summary_index_tbs_name   VARCHAR2(80) := NULL;
102     other_table_tbs_name     VARCHAR2(80) := NULL;
103     other_index_tbs_name     VARCHAR2(80) := NULL;
104 
105 /*===========================================================================+
106 |
107 |   Name:          Add_Value_Big_In_Cond
108 |
109 |   Description:   Insert the given value into the temporary table of big
110 |                  'in' conditions for the given variable_id.
111 |
112 |   Parameters:    x_variable_id  variable id.
113 |                  x_value        value
114 |
115 +============================================================================*/
116 PROCEDURE Add_Value_Big_In_Cond(
117     x_variable_id IN NUMBER,
118     x_value IN NUMBER
119     );
120 
121 /*===========================================================================+
122 |
123 |   Name:          Add_Value_Big_In_Cond
124 |
125 |   Description:   Insert the given value into the temporary table of big
126 |                  'in' conditions for the given variable_id.
127 |
128 |   Parameters:    x_variable_id  variable id.
129 |                  x_value        value
130 |
131 +============================================================================*/
132 PROCEDURE Add_Value_Big_In_Cond(
133     x_variable_id IN NUMBER,
134     x_value IN VARCHAR2
135     );
136 
137 /*===========================================================================+
138 |
139 |   Name:          Apps_Initialize_VB
140 |
141 |   Description:   Based on the responsibility, initialize the application.
142 |                  This procedure is to be called from a VB program.
143 |                  If there is an error, the procedure inserts the error
144 |                  message in BSC_MESSAGE_LOGS table.
145 |
146 |   Parameters:    x_user_id      User id.
147 |                  x_resp_id      Responsibility id
148 |
149 +============================================================================*/
150 PROCEDURE Apps_Initialize_VB(
151     x_user_id IN NUMBER,
152     x_resp_id IN NUMBER
153     );
154 
155 
156 /*===========================================================================+
157 |
158 |   Name:          CheckError
159 |
160 |   Description:   Check if there is an error in BSC_MESSAGE_LOGS registered
161 |                  by the given functoin name.
162 |
163 |   Parameters:    x_calling_function     Nae of the function/procedure
164 |
165 +============================================================================*/
166 FUNCTION CheckError (
167     x_calling_function IN VARCHAR2
168 ) RETURN BOOLEAN;
169 
170 
171 /*===========================================================================+
172 |
173 |   Name:          Do_DDL
174 |
175 |   Description:   Execute the given DDL statement.
176 |                  If the environment is APPS it uses AD_DDL.DO_DDL procedure
177 |                  who execute the statement in the proper schema. Additionally
178 |                  creates a grant/synonym to APPS schema if it is necessary.
179 |                  Otherwise the statement is execute in the current schema.
180 |
181 |   Parameters:    x_statement      DDL statement. This is the only parameter
182 |                   for Personal environment.
183 |                  x_statement_type One of the folowing macros:
184 |                   ad_ddl.alter_sequence
185 |                   ad_ddl.alter_table
186 |                   ad_ddl.alter_trigger
187 |                                       ad_ddl.alter_view
188 |                                       ad_ddl.create_index
189 |                                       ad_ddl.create_sequence
190 |                                       ad_ddl.create_synonym
191 |                                       ad_ddl.create_table
192 |                                       ad_ddl.create_trigger
193 |                                       ad_ddl.create_view
194 |                                       ad_ddl.drop_index
195 |                                       ad_ddl.drop_sequence
196 |                                       ad_ddl.drop_synonym
197 |                                       ad_ddl.drop_table
198 |                                       ad_ddl.drop_trigger
199 |                                       ad_ddl.drop_view
200 |                                       ad_ddl.truncate_table
201 |                  x_object_name    The name of the object you are affecting
202 |
203 |   Notes: This procedure propagate any oracle error that is encountered.
204 |
205 +============================================================================*/
206 PROCEDURE Do_DDL(
207     x_statement IN VARCHAR2,
208         x_statement_type IN INTEGER := 0,
209         x_object_name IN VARCHAR2 := NULL
210     );
211 
212 
213 /*===========================================================================+
214 |
215 |   Name:          Do_DDL_AT
216 |
217 |   Description:   Execute the given DDL statement within an
218 |                  AUTOMOMOUS TRANSACTION. This means that the implicit
219 |                  commit executed by the ddl do not commit the
220 |                  transaction that caller is executing.
221 +============================================================================*/
222 PROCEDURE Do_DDL_AT(
223     x_statement IN VARCHAR2,
224     x_statement_type IN INTEGER := 0,
225     x_object_name IN VARCHAR2 := NULL,
226     x_fnd_apps_schema IN VARCHAR2,
227     x_bsc_apps_short_name IN VARCHAR2
228     );
229 
230 
231 /*===========================================================================+
232 |
233 |   Name:          Do_DDL_VB
234 |
235 |   Description:   Execute the given DDL statement.
236 |                  This procedure is for VB clients. It calls DO_DDL procedure
237 |                  and inserts any error in BSC_MESSAGE_LOGS table.
238 |
239 |   Parameters:    x_statement      DDL statement. This is the only parameter
240 |                   for Personal environment.
241 |                  x_statement_type One of the folowing macros:
242 |                   ad_ddl.alter_sequence
243 |                   ad_ddl.alter_table
244 |                   ad_ddl.alter_trigger
245 |                                       ad_ddl.alter_view
246 |                                       ad_ddl.create_index
247 |                                       ad_ddl.create_sequence
248 |                                       ad_ddl.create_synonym
249 |                                       ad_ddl.create_table
250 |                                       ad_ddl.create_trigger
251 |                                       ad_ddl.create_view
252 |                                       ad_ddl.drop_index
253 |                                       ad_ddl.drop_sequence
254 |                                       ad_ddl.drop_synonym
255 |                                       ad_ddl.drop_table
256 |                                       ad_ddl.drop_trigger
257 |                                       ad_ddl.drop_view
258 |                                       ad_ddl.truncate_table
259 |                  x_object_name    The name of the object you are affecting
260 |
261 +============================================================================*/
262 PROCEDURE Do_DDL_VB(
263     x_statement IN VARCHAR2,
264         x_statement_type IN INTEGER := 0,
265         x_object_name IN VARCHAR2 := NULL
266     );
267 
268 
269 /*===========================================================================+
270 |
271 |   Name:          Execute_DDL
272 |
273 |   Description:   Execute the given DDL statement in current squema.
274 |
275 |   Parameters:    x_statement      DDL statement.
276 |
277 +============================================================================*/
278 PROCEDURE Execute_DDL(
279     x_statement IN VARCHAR2
280     );
281 
282 
283 /*===========================================================================+
284 |
285 |   Name:          Execute_DDL_Stmts_AT
286 |
287 |   Description:   Execute the given DDL statements. It uses DO_DDL_AT
288 |                  (autonomous transaction)
289 |
290 +============================================================================*/
291 PROCEDURE Execute_DDL_Stmts_AT(
292     x_array_ddl_stmts IN t_array_ddl_stmts,
293     x_num_ddl_stmts IN NUMBER,
294     x_fnd_apps_schema IN VARCHAR2,
295     x_bsc_apps_short_name IN VARCHAR2
296     );
297 
298 
299 /*===========================================================================+
300 |
301 |   Name:          Execute_Immediate
302 |
303 |   Description:   Execute the given sql statmentent
304 |
305 |   Parameters:    x_sql - sql statement
306 |
307 |   Notes:
308 |
309 +============================================================================*/
310 PROCEDURE Execute_Immediate(
311     x_sql IN VARCHAR2
312     );
313 
314 
315 /*===========================================================================+
316 |
317 |   Name:          Get_Lookup_Value
318 |
319 |   Description:   This function returns the LOOKUP value of the given
320 |                  LOOKUP type and LOOKUP code
321 |
322 |   Notes:
323 |
324 +============================================================================*/
325 FUNCTION Get_Lookup_Value(
326     x_lookup_type IN VARCHAR2,
327         x_lookup_code IN VARCHAR2
328     ) RETURN VARCHAR2;
329 
330 
331 /*===========================================================================+
332 |
333 |   Name:          Get_Lookup_Value
334 |
335 |   Description:   This procedure returns the LOOKUP value of the given
336 |                  LOOKUP type and LOOKUP code in x_meaning out NOCOPY parameter
337 |
338 |   Notes:
339 |
340 +============================================================================*/
341 PROCEDURE Get_Lookup_Value(
342     x_lookup_type  in   varchar2,
343     x_lookup_code  in   varchar2,
344     x_meaning      out NOCOPY  varchar2 );
345 
346 
347 /*===========================================================================+
348 |
349 |   Name:          Get_Message
350 |
351 |   Description:   This function returns the translated message
352 |                  of the given message code
353 |
354 |   Notes:
355 |
356 +============================================================================*/
357 FUNCTION Get_Message(
358     x_message_name IN VARCHAR2
359     ) RETURN VARCHAR2;
360 
361 
362 /*===========================================================================+
363 |
364 |   Name:          Get_New_Big_In_Cond_Number
365 |
366 |   Description:   Clean values for the given variable_id and return a 'IN'
367 |                  condition string.
368 |
369 |   Parameters:    x_variable_id  variable id.
370 |                  x_column_name  column name (left part of the condition)
371 |
372 +============================================================================*/
373 FUNCTION Get_New_Big_In_Cond_Number(
374     x_variable_id IN NUMBER,
375     x_column_name IN VARCHAR2
376     ) RETURN VARCHAR2;
377 
378 
379 /*===========================================================================+
380 |
381 |   Name:          Get_New_Big_In_Cond_Varchar2
382 |
383 |   Description:   Clean values for the given variable_id and return a 'IN'
384 |                  condition string.
385 |
389 +============================================================================*/
386 |   Parameters:    x_variable_id  variable id.
387 |                  x_column_name  column name (left part of the condition)
388 |
390 FUNCTION Get_New_Big_In_Cond_Varchar2(
391     x_variable_id IN NUMBER,
392     x_column_name IN VARCHAR2
393     ) RETURN VARCHAR2;
394 
395 
396 /*===========================================================================+
397 |
398 |   Name:          Get_New_Big_In_Cond_Varchar2NU
399 |
400 |   Description:   Clean values for the given variable_id and return a 'IN'
401 |                  condition string.
402 |
403 |   Parameters:    x_variable_id  variable id.
404 |                  x_column_name  column name (left part of the condition)
405 |
406 +============================================================================*/
407 FUNCTION Get_New_Big_In_Cond_Varchar2NU(
408     x_variable_id IN NUMBER,
409     x_column_name IN VARCHAR2
410     ) RETURN VARCHAR2;
411 
412 
413 /*===========================================================================+
414 |
415 |   Name:          Get_Property_Value
416 |
417 |   Description:   Given a list of pairs <property_name>=<property_value>
418 |                  separated by '&', this function returns the property_value
419 |                  of the given property_name. If the property does not exists
420 |                  in the list, it returns NULL.
421 +============================================================================*/
422 FUNCTION Get_Property_Value(
423     p_property_list IN VARCHAR2,
424     p_property_name IN VARCHAR2
425     ) RETURN VARCHAR2;
426 PRAGMA RESTRICT_REFERENCES(Get_Property_Value, WNDS);
427 
428 
429 /*===========================================================================+
430 |
431 |   Name:          Set_Property_Value
432 |
433 |   Description:   Given a list of pairs <property_name>=<property_value>
434 |                  separated by '&', this function add/replace the list
435 |                  with the given <property_name>=<property_value>
436 +============================================================================*/
437 FUNCTION Set_Property_Value(
438     p_property_list IN VARCHAR2,
439     p_property_name IN VARCHAR2,
440     p_property_value IN VARCHAR2
441     ) RETURN VARCHAR2;
442 PRAGMA RESTRICT_REFERENCES(Set_Property_Value, WNDS);
443 
444 
445 /*===========================================================================+
446 |
447 |   Name:          Get_Request_Status_VB
448 |
449 |   Description:   This function returns in BSC_MESSAGE_LOGS the status
450 |                  of the concurrent request to be read by VB Loader
451 +============================================================================*/
452 PROCEDURE Get_Request_Status_VB(
453     x_request_id IN NUMBER
454     );
455 
456 
457 /*===========================================================================+
458 |
459 |   Name:          Get_Storage_Clause
460 |
461 |   Description:   This function returns the storage clause that needs
462 |                  to be used when creating tables or indexes.
463 +============================================================================*/
464 FUNCTION Get_Storage_Clause RETURN VARCHAR2;
465 PRAGMA RESTRICT_REFERENCES(Get_Storage_Clause, WNDS);
466 
467 
468 /*===========================================================================+
469 |
470 |   Name:          Get_Tablespace_Clause_Tbl
471 |
472 |   Description:   This function returns the tablespace clause that needs
473 |                  to be used when creating tables.
474 +============================================================================*/
475 FUNCTION Get_Tablespace_Clause_Tbl RETURN VARCHAR2;
476 PRAGMA RESTRICT_REFERENCES(Get_Tablespace_Clause_Tbl, WNDS);
477 
478 
479 /*===========================================================================+
480 |
481 |   Name:          Get_Tablespace_Clause_Idx
482 |
483 |   Description:   This function returns the tablespace clause that needs
484 |                  to be used when creating indexes.
485 +============================================================================*/
486 FUNCTION Get_Tablespace_Clause_Idx RETURN VARCHAR2;
487 PRAGMA RESTRICT_REFERENCES(Get_Tablespace_Clause_Idx, WNDS);
488 
489 
490 /*===========================================================================+
491 |
492 |   Name:          Get_Tablespace_Name
493 |
494 |   Description:   This function returns the tablespace name according to the
495 |                  new tablespace clasiffication
496 |
497 |   Parameter:
498 |              x_tablespace_type IN VARCHAR2
499 |                   Pass one the following values:
500 |                   - BSC_APPS.dimension_table_tbs_type
501 |                   - BSC_APPS.dimension_index_tbs_type
502 |                   - BSC_APPS.input_table_tbs_type
503 |                   - BSC_APPS.input_index_tbs_type
504 |                   - BSC_APPS.base_table_tbs_type
505 |                   - BSC_APPS.base_index_tbs_type
506 |                   - BSC_APPS.summary_table_tbs_type
507 |                   - BSC_APPS.summary_index_tbs_type
508 +============================================================================*/
512 
509 FUNCTION Get_Tablespace_Name (
510     x_tablespace_type IN VARCHAR2
511 ) RETURN VARCHAR2;
513 
514 /*===========================================================================+
515 |
516 |   Name:          Init_Big_In_Cond_Table
517 |
518 |   Description:   This function creates temporal table BSC_TMP_BIG_IN_COND
519 |                  if it does not exist in the database and delete any record
520 |                  for the current session.
521 +============================================================================*/
522 PROCEDURE Init_Big_In_Cond_Table;
523 
524 
525 /*===========================================================================+
526 |
527 |   Name:          Init_Bsc_Apps
528 |
529 |   Description:   Initialize global variables:
530 |                  apps_env     TRUE    The environment is APPS
531 |               FALSE   The environment is Personal
532 |          bsc_apps_schema  Name of BSC schema in APPS
533 |
534 |
535 |   Notes: You must call this procedure before call aby other BSC_APPS package
536 |          procedure.
537 |
538 +============================================================================*/
539 PROCEDURE Init_Bsc_Apps;
540 
541 
542 /*===========================================================================+
543 |
544 |   Name:          Init_Log_File
545 |
546 |   Description:   This function creates the log file. Additionally,
547 |              write the standard header to the log file.
548 |
549 |              The log file directory must be in the variable
550 |          UTL_FILE_DIR of INIT table.
551 |
552 |          Initialize package variables:
553 |          g_log_file_name  - Log file name
554 |          g_log_file_dir   - Lof file directory.
555 |
556 |   Returns:       If any error ocurrs, this function write the error message
557 |          in the parameter x_msg_error and return FALSE. Otherwise return
558 |          TRUE.
559 |
560 |   Notes:
561 |
562 +============================================================================*/
563 FUNCTION Init_Log_File (
564     x_log_file_name IN VARCHAR2,
565         x_error_msg OUT NOCOPY VARCHAR2
566         ) RETURN BOOLEAN;
567 
568 
569 /*===========================================================================+
570 |
571 |   Name:          Log_File_Dir
572 |
573 |   Description:   This function returns the log file directory
574 |
575 |   Notes:
576 |
577 +============================================================================*/
578 FUNCTION Log_File_Dir RETURN VARCHAR2;
579 
580 
581 /*===========================================================================+
582 |
583 |   Name:          Log_File_Name
584 |
585 |   Description:   This function returns the log file name
586 |
587 |   Notes:
588 |
589 +============================================================================*/
590 FUNCTION Log_File_Name RETURN VARCHAR2;
591 
592 
593 /*===========================================================================+
594 |
595 |   Name:          Object_Exists
596 |
597 |   Description:   Checks whether the specific object exists in the
598 |          database.
599 |
600 |   Parameters:    x_object - object name.
601 |
602 |   Returns:       TRUE - Object exists in the database.
603 |          FALSE - Object does not exist in the database.
604 |
605 |   Notes:
606 |
607 +============================================================================*/
608 FUNCTION Object_Exists(
609     x_object IN VARCHAR2
610     ) RETURN BOOLEAN;
611 
612 
613 /*===========================================================================+
614 |
615 |   Name:          Replace_Token
616 |
617 |   Description:   This function returns the message replacin the given token.
618 |
619 |   Notes:
620 |
621 +============================================================================*/
622 FUNCTION Replace_Token(
623     x_message IN VARCHAR2,
624     x_token_name IN VARCHAR2,
625     x_token_value IN VARCHAR2
626     ) RETURN VARCHAR2;
627 
628 
629 /*===========================================================================+
630 |
631 |   Name:          Submit_Request_VB
632 |
633 |   Description:   This procedure submits a request for concurrent program.
634 |                  This procedure is to be called from a VB program.
635 |                  It inserts the request_id in BSC_MESSAGE_LOGS table
636 |                  (type = 3, information) to VB program be able to get it.
637 |                  If there is an error, the procedure inserts the error
638 |                  message in BSC_MESSAGE_LOGS table.
639 |
640 |   Parameters:    x_program      Name of the concurrent program for which
641 |                                 the request should be submitted.
642 |                  x_start_time   Time at which the request should start
643 |                                 running.
644 |                  x_argument1
645 |                  ...
646 |                  x_argument20
647 |
648 +============================================================================*/
649 PROCEDURE Submit_Request_VB(
650     x_program IN VARCHAR2,
651     x_start_time IN VARCHAR2 DEFAULT NULL,
652     x_argument1 IN VARCHAR2 DEFAULT NULL,
656     x_argument5 IN VARCHAR2 DEFAULT NULL,
653     x_argument2 IN VARCHAR2 DEFAULT NULL,
654     x_argument3 IN VARCHAR2 DEFAULT NULL,
655     x_argument4 IN VARCHAR2 DEFAULT NULL,
657     x_argument6 IN VARCHAR2 DEFAULT NULL,
658     x_argument7 IN VARCHAR2 DEFAULT NULL,
659     x_argument8 IN VARCHAR2 DEFAULT NULL,
660     x_argument9 IN VARCHAR2 DEFAULT NULL,
661     x_argument10 IN VARCHAR2 DEFAULT NULL,
662     x_argument11 IN VARCHAR2 DEFAULT NULL,
663     x_argument12 IN VARCHAR2 DEFAULT NULL,
664     x_argument13 IN VARCHAR2 DEFAULT NULL,
665     x_argument14 IN VARCHAR2 DEFAULT NULL,
666     x_argument15 IN VARCHAR2 DEFAULT NULL,
667     x_argument16 IN VARCHAR2 DEFAULT NULL,
668     x_argument17 IN VARCHAR2 DEFAULT NULL,
669     x_argument18 IN VARCHAR2 DEFAULT NULL,
670     x_argument19 IN VARCHAR2 DEFAULT NULL,
671     x_argument20 IN VARCHAR2 DEFAULT NULL
672     );
673 
674 
675 /*===========================================================================+
676 |
677 |   Name:          Index_Exists
678 |
679 |   Description:   Checks whether the specific index exists in the
680 |          database.
681 |
682 |   Parameters:    x_index - index name.
683 |
684 |   Returns:       TRUE - Index exists in the database.
685 |          FALSE - Index does not exist in the database.
686 |
687 |   Notes:
688 |
689 +============================================================================*/
690 FUNCTION Index_Exists(
691     x_index IN VARCHAR2
692     ) RETURN BOOLEAN;
693 
694 
695 /*===========================================================================+
696 |
697 |   Name:          Table_Exists
698 |
699 |   Description:   Checks whether the specific table exists in the
700 |          database.
701 |
702 |   Parameters:    x_table - table name.
703 |
704 |   Returns:       TRUE - Table exists in the database.
705 |          FALSE - Table does not exist in the database.
706 |
707 |   Notes:
708 |
709 +============================================================================*/
710 FUNCTION Table_Exists(
711     x_table IN VARCHAR2
712     ) RETURN BOOLEAN;
713 
714 
715 /*===========================================================================+
716 |
717 |   Name:          View_Exists
718 |
719 |   Description:   Checks whether the specific view exists in the
720 |          database.
721 |
722 |   Parameters:    x_view - view name.
723 |
724 |   Returns:       TRUE - View exists in the database.
725 |          FALSE - View does not exist in the database.
726 |
727 |   Notes:
728 |
729 +============================================================================*/
730 FUNCTION View_Exists(
731     x_view  IN VARCHAR2
732     ) RETURN BOOLEAN;
733 
734 
735 /*===========================================================================+
736 |
737 |   Name:          Wait_For_Request_VB
738 |
739 |   Description:   This procedure waits for request completion.
740 |                  This procedure is to be called from a VB program.
741 |                  If there is an error, the procedure inserts the error
742 |                  message in BSC_MESSAGE_LOGS table.
743 |
744 |   Parameters:    x_request_id   The request ID of the request to wait on.
745 |
746 +============================================================================*/
747 PROCEDURE Wait_For_Request_VB(
748     x_request_id IN NUMBER,
749         x_interval IN NUMBER,
750         x_max_wait IN NUMBER
751     );
752 
753 
754 /*===========================================================================+
755 |
756 |   Name:          Write_Errors_To_Log
757 |
758 |   Description:   This procedure writes the messages that are in
759 |                  BSC_MESSAGE_LOGS table corresponding to the current session
760 |          id, into the log file.
761 |
762 |          If the log file is not initialized then this procedure
763 |          doesn't do anything. This is not an error.
764 |
765 |   Notes:
766 |
767 +============================================================================*/
768 PROCEDURE Write_Errors_To_Log;
769 
770 
771 /*===========================================================================+
772 |
773 |   Name:          Write_Line_Log
774 |
775 |   Description:   This procedure write the given string into the log file
776 |
777 |          If the log file is not initialized then this procedure
778 |          doesn't do anything. This is not an error.
779 |
780 |   Notes:
781 |
785         x_which IN NUMBER
782 +============================================================================*/
783 PROCEDURE Write_Line_Log (
784     x_line IN VARCHAR2,
786     );
787 /*===========================================================================+
788 |   Name:          IS_BSC_USER_VALID
789 |
790 |   Description:   This fucntion return 1, if the user_id is a Valid BSc user.
791 |                  It means that has BSC responsibility and the resp. is between
792 |                   start and end date
793 |   Notes:
794 +============================================================================*/
795 FUNCTION IS_BSC_USER_VALID(
796   X_USER_ID in NUMBER) RETURN NUMBER;
797 
798 /*===========================================================================+
799 |   Name:          Is_Bsc_Design_User_Valid
800 |
801 |   Description:   This function return 1, if the user_id is a Valid BSC design user.
802 |                  It means that user has BSC Manager and Performnace Management Designer
803 |                  and the resp. is between start and end date
804 |   Notes:
805 |
806 +============================================================================*/
807 FUNCTION Is_Bsc_Design_User_Valid (
808   x_User_Id IN NUMBER) RETURN NUMBER;
809 
810 /*===========================================================================+
811 |   Name:          GET_USER_FULL_NAME
812 |
813 |   Description:   This fucntion return teh full name of the user from
814 |                  per_all_people_f table
815 |   Notes:
816 +============================================================================*/
817 FUNCTION GET_USER_FULL_NAME(
818   X_USER_ID in NUMBER) RETURN VARCHAR2;
819 
820 /*===========================================================================+
821 |   Name:          get_user_schema
822 |
823 |   Description:   The fuction return the BSC schema name
824 |
825 |   Notes:
826 +============================================================================*/
827 FUNCTION get_user_schema
828 RETURN VARCHAR2;
829 
830 /*===========================================================================+
831 |   Name:          get_user_schema ( over loaded)
832 |
833 |   Description:   The function return the schema name for the application
834 |                  short name passed
835 |   Notes:
836 +============================================================================*/
837 
838 FUNCTION get_user_schema (p_app_short_name IN  varchar2)
839 RETURN VARCHAR2;
840 
841 /*===========================================================================+
842 | PROCEDURE Do_DDL_AT, use to execute multiple statments under single
843 |                      Autonomous Transaction.
844 +============================================================================*/
845 
846 
847 PROCEDURE Do_DDL_AT(
848     x_Statements_Tbl   IN   BSC_APPS.Autonomous_Statements_Tbl_Type
849 );
850 
851 /*===========================================================================+
852 | FUNCTION Get_Bsc_Message
853 +============================================================================*/
854 FUNCTION Get_Bsc_Message
855 (   p_Message_Name IN VARCHAR2,
856     p_Token_Names  IN VARCHAR2,
857     p_Lookup_Codes IN VARCHAR2,
858     p_Lookup_Types IN VARCHAR2
859 ) RETURN VARCHAR2;
860 
861 END BSC_APPS;