1 PACKAGE FII_UTIL AUTHID CURRENT_USER AS
2 /* $Header: FIIUTILS.pls 115.11 2004/08/10 23:24:19 phu noship $ */
3 VERSION CONSTANT CHAR(80) := '$Header: FIIUTILS.pls 115.11 2004/08/10 23:24:19 phu noship $';
4
5 -- ------------------------
6 -- Global Variables
7 -- ------------------------
8 g_obj_name VARCHAR2(100);
9
10 -- ------------------------
11 -- Public Procedures
12 -- ------------------------
13
14 -- ------------------------------------------------------------------
15 -- Name: Initializes variables for logging other utility functions
16 -- Desc: 1. Setup which directory to put the log and what the log file
17 -- name is. The directory setup is used only if the program
18 -- is not run thru concurrent manager.
19 -- 2. Set up the debug flag if the debug profile is set
20 -- -----------------------------------------------------------------
21 PROCEDURE initialize(
22 p_log_file VARCHAR2 default 'fii_debug.log',
23 p_out_file VARCHAR2 default 'fii_debug.out',
24 p_directory VARCHAR2 default NULL,
25 p_obj_name VARCHAR2 default 'FII'
26 );
27
28 -- ------------------------------------------------------------------
29 -- Name: debug_line
30 -- Desc: If debug flag is turned on, the message will be printed
31 -- All debug messages are concatenated with "DEBUG: " prefix
32 -- -----------------------------------------------------------------
33 PROCEDURE debug_line(
34 p_text VARCHAR2);
35
36 -- ------------------------------------------------------------------
37 -- Name: put_line
38 -- Desc: For now, just a wrapper on top of fnd_file
39 -- -----------------------------------------------------------------
40 PROCEDURE put_line(
41 p_text VARCHAR2);
42
43 -- ------------------------------------------------------------------
44 -- Name: put_timestamp
45 -- Desc: Prints the message along with the current timestamp
46 -- -----------------------------------------------------------------
47 PROCEDURE put_timestamp(
48 p_text VARCHAR2 default 'Time Stamp');
49
50
51 -- ------------------------------------------------------------------
52 -- Name: start_timer
53 -- Desc: Starts the internal timer. If timer already started, it
54 -- re-sets the start time
55 -- -----------------------------------------------------------------
56 PROCEDURE start_timer;
57
58 -- ------------------------------------------------------------------
59 -- Name: stop_timer
60 -- Desc: Stop the internal timer and stores the duration in
61 -- number of days.
62 -- -----------------------------------------------------------------
63 PROCEDURE stop_timer;
64
65 -- ------------------------------------------------------------------
66 -- Name: print_timer
67 -- Desc: Prints the message along with the current timer display.
68 -- If the timer is still running, it prints the duration since
69 -- the timer was started. If the timer has been stopped, it
70 -- prints the duration between last timer start and stop.
71 -- The duration are printed in the following format: x days HH:MM:SS
72 -- -----------------------------------------------------------------
73 PROCEDURE print_timer(
74 p_text VARCHAR2 default 'Duration');
75
76
77 -- -----------------------------------------------------------------
78 -- Name: get_schema_name
79 -- Desc: Return the schema name of p_app_short_name, which is
80 -- default to 'FII'.
81 -- Return null for error.
82 -- -----------------------------------------------------------------
83 FUNCTION get_schema_name(
84 p_app_short_name in varchar2 default 'FII'
85 ) return varchar2;
86
87
88 -- -----------------------------------------------------------------
89 -- Name: get_apps_schema_name
90 -- Desc: Return the schema name of APPS
91 -- Return NULL for error
92 -- -----------------------------------------------------------------
93 FUNCTION get_apps_schema_name return varchar2;
94
95
96 -- -----------------------------------------------------------------
97 -- Name: truncate_table
98 -- Desc: Truncate table p_table_name in the schema of
99 -- p_app_short_name, which is default to 'FII'.
100 -- Set p_retcode to '-1' if error occurs, otherwise
101 -- set p_retcode to '0'.
102 -- -----------------------------------------------------------------
103 PROCEDURE truncate_table(
104 p_table_name in varchar2,
105 p_app_short_name in varchar2 default 'FII',
106 p_retcode out nocopy varchar2
107 );
108
109 -- -----------------------------------------------------------------
110 -- Name: drop_table
111 -- Desc: Drop table p_table_name in the schema of
112 -- p_app_short_name, which is default to 'FII'.
113 -- Set p_retcode to '-1' if error occurs, otherwise
114 -- set p_retcode to '0'.
115 -- -----------------------------------------------------------------
116 PROCEDURE drop_table(
117 p_table_name in varchar2,
118 p_app_short_name in varchar2 default 'FII',
119 p_retcode out nocopy varchar2
120 );
121
122
123 /*---------------------------------------------------------------------
124 Call to get the log directory when running program from SQLPLUS
125
126 Doing so by parsing the 'utl_file_dir' init.ora parameter and scanning
127 for the word log and getting that string out.
128 ---------------------------------------------------------------------*/
129 Function get_Utl_File_Dir return VARCHAR2;
130
131 -- ------------------------------------------------------------------
132 -- Name: write_log
133 -- Desc: just a wrapper on top of fnd_file
134 -- -----------------------------------------------------------------
135 PROCEDURE write_log( p_text VARCHAR2);
136
137 -- ------------------------------------------------------------------
138 -- Name: write_output
139 -- Desc: just a wrapper on top of fnd_file
140 -- -----------------------------------------------------------------
141 PROCEDURE write_output( p_text VARCHAR2);
142
143 end;