1 PACKAGE BIS_VG_UTIL AUTHID CURRENT_USER AS
2 /* $Header: BISTUTLS.pls 115.8 2002/03/27 08:18:57 pkm ship $ */
3
4 -- Copyright (c) 1998 Oracle Corporation, Redwood Shores, CA, USA
5 -- All rights reserved.
6 --
7 -- FILENAME
8 --
9 -- BISTUTLS.pls
10 --
11 -- DESCRIPTION
12 --
13 -- spec of view generator util to be used in the view generator
14 -- package specifyling the view security
15 --
16 -- NOTES
17 --
18 -- HISTORY
19 --
20 -- 21-JUL-98 Created
21 -- 07-FEB-01 Edited by DBOWLES Added Find_Flex_Prompt function
22 -- 10-DEC-01 Edited by DBOWLES Added db driver comment
23 --
24 --
25 ---- Data Type: Records and Tables
26 G_SHORT_NAME_LEN Number := 20;
27 G_ERROR VARCHAR2(1) := 'E';
28 G_WARNING VARCHAR2(1) := 'W';
29
30 TYPE Error_Rec_Type IS RECORD
31 ( Error_Msg_ID Number := FND_API.G_MISS_NUM
32 , Error_Msg_Name VARCHAR2(30) := FND_API.G_MISS_CHAR
33 , Error_Description VARCHAR2(2000) := FND_API.G_MISS_CHAR
34 , Error_Proc_Name VARCHAR2(100) := FND_API.G_MISS_CHAR
35 , Error_Type VARCHAR2(1) := G_ERROR );
36
37 TYPE Error_Tbl_Type IS TABLE of Error_Rec_Type
38 INDEX BY BINARY_INTEGER;
39 --
40
41 -- returns TRUE if p_character is a delimiter
42 FUNCTION is_char_delimiter
43 ( p_character IN VARCHAR2
44 , x_return_status OUT VARCHAR2
45 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
46 )
47 RETURN BOOLEAN;
48 --
49 -- creates a table of varchars from a single VARCHAR2 such that
50 -- each LENGTH(row) <= 250
51 PROCEDURE create_Text_Table
52 ( p_String IN VARCHAR2
53 , x_View_Table OUT bis_vg_types.View_Text_Table_Type
54 , x_return_status OUT VARCHAR2
55 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
56 );
57 --
58 -- returns a valid column name after verification
59 FUNCTION get_valid_col_name
60 ( p_Col_Name IN VARCHAR2
61 , x_return_status OUT VARCHAR2
62 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
63 )
64 RETURN VARCHAR2;
65 --
66 -- returns the string with the prefix and suffix and strlen <= 30
67 FUNCTION get_string_len30
68 ( p_String IN VARCHAR2
69 , p_Prefix IN VARCHAR2
70 , p_Suffix IN VARCHAR2
71 , x_return_status OUT VARCHAR2
72 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
73 )
74 RETURN VARCHAR2;
75 --
76 --returns TRUE if p_start_pointer = p_end_pointer else returns FALSE
77
78 FUNCTION equal_pointers
79 ( p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
80 , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
81 , x_return_status OUT VARCHAR2
82 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
83 )
84 RETURN BOOLEAN;
85 --
86 -- returns the string between p_start and p_end
87 -- end is not included
88
89 FUNCTION get_string
90 ( p_view_table IN bis_vg_types.View_Text_Table_Type
91 , p_start_pointer IN bis_vg_types.View_Character_Pointer_Type
92 , p_end_pointer IN bis_vg_types.View_Character_Pointer_Type
93 , x_return_status OUT VARCHAR2
94 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
95 )
96 RETURN VARCHAR2;
97
98 -- returns the charater pointed to by the p_pointer
99 FUNCTION get_char
100 ( p_view_table IN bis_vg_types.View_Text_Table_Type
101 , p_pointer IN bis_vg_types.View_Character_Pointer_Type
102 , x_return_status OUT VARCHAR2
103 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
104 )
105 RETURN VARCHAR2;
106
107 -- increments pointer by one
108 FUNCTION increment_pointer
109 ( p_view_table IN bis_vg_types.View_Text_Table_Type
110 , p_pointer IN bis_vg_types.View_Character_Pointer_Type
111 , x_return_status OUT VARCHAR2
112 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
113 )
114 RETURN bis_vg_types.view_character_pointer_type;
115
116 -- concatenates p_View_Table_A with p_View_Table_B
117 PROCEDURE concatenate_Tables
118 ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
119 , p_View_Table_B IN BIS_VG_TYPES.View_Text_Table_Type
120 , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
121 , x_return_status OUT VARCHAR2
122 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
123 );
124 -- concatenates p_View_Table_A with p_View_Table_B Flex_Column_Comment
125 PROCEDURE concatenate_Tables
126 ( p_View_Table_A IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
127 , p_View_Table_B IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
128 , x_View_Table OUT BIS_VG_TYPES.Flex_Column_Comment_Table_Type
129 , x_return_status OUT VARCHAR2
130 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
131 );
132 -- copies the part between the pointers into a table
133 -- character pointed to by start is copied
134 -- character pointed to by end is not copied
135
136 PROCEDURE copy_part_of_table
137 ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
138 , p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
139 , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
140 , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
141 , x_return_status OUT VARCHAR2
142 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
143 );
144
145 PROCEDURE print_View_Text
146 ( p_View_Text_Table IN BIS_VG_TYPES.View_Text_Table_Type
147 , x_return_status OUT VARCHAR2
148 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
149 );
150
151 PROCEDURE print_View_pointer
152 ( p_pointer IN BIS_VG_TYPES.View_character_pointer_type
153 , x_return_status OUT VARCHAR2
154 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
155 );
156
157 -- position the pointer before trailing characters
158 FUNCTION position_before_characters
159 ( p_View_Text_Table IN BIS_VG_TYPES.view_text_table_type
160 , p_str IN VARCHAR2
161 , p_pointer IN bis_vg_types.view_character_pointer_type
162 , x_return_status OUT VARCHAR2
163 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
164 )
165 RETURN bis_vg_types.view_character_pointer_type;
166
167 -- position the pointer before trailing characters
168 FUNCTION position_before_characters
169 ( p_View_Text_Table IN BIS_VG_TYPES.view_text_table_type
170 , p_str IN VARCHAR2
171 , x_return_status OUT VARCHAR2
172 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
173 )
174 RETURN bis_vg_types.view_character_pointer_type;
175
179 , p_pointer IN bis_vg_types.View_Character_Pointer_Type
176 -- decrements pointer by one
177 FUNCTION decrement_pointer
178 ( p_view_table IN bis_vg_types.View_Text_Table_Type
180 , x_return_status OUT VARCHAR2
181 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
182 )
183 RETURN bis_vg_types.view_character_pointer_type;
184
185 -- return TRUE if pointer is a null
186 FUNCTION null_pointer
187 (p_pointer IN bis_vg_types.view_character_pointer_type
188 , x_return_status OUT VARCHAR2
189 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
190 )
191 RETURN BOOLEAN;
192
193 -- returns the row pointed to by the pointer
194 FUNCTION get_row
195 ( p_view_table IN bis_vg_types.View_Text_Table_Type
196 , p_pointer IN bis_vg_types.View_Character_Pointer_Type
197 , x_return_status OUT VARCHAR2
198 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
199 )
200 RETURN bis_vg_types.view_text_table_rec_type;
201
202 -- increments the pointer to next row
203 FUNCTION increment_pointer_by_row
204 ( p_view_table IN bis_vg_types.View_Text_Table_Type
205 , p_pointer IN bis_vg_types.View_Character_Pointer_Type
206 , x_return_status OUT VARCHAR2
207 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
208 )
209 RETURN bis_vg_types.view_character_pointer_type;
210
211 -- this function returns the generated view name for the original view name
212 FUNCTION get_generated_view_name
213 (p_view_name IN VARCHAR2
214 , x_return_status OUT VARCHAR2
215 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
216 )
217 RETURN VARCHAR2;
218
219 -- these procedures check and puts the error message on the message stack
220 PROCEDURE add_message
221 ( p_msg_name IN VARCHAR2
222 , p_msg_level IN NUMBER
223 , x_return_status OUT VARCHAR2
224 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
225 );
226
227 PROCEDURE add_message
228 ( p_msg_name IN VARCHAR2
229 , p_msg_level IN NUMBER
230 , p_token1 IN VARCHAR2
231 , p_value1 IN VARCHAR2
232 , x_return_status OUT VARCHAR2
233 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
234 );
235
236 PROCEDURE add_message
237 ( p_msg_name IN VARCHAR2
238 , p_msg_level IN NUMBER
239 , p_token1 IN VARCHAR2
240 , p_value1 IN VARCHAR2
241 , p_token2 IN VARCHAR2
242 , p_value2 IN VARCHAR2
243 , x_return_status OUT VARCHAR2
244 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
245 );
246
247 PROCEDURE add_message
248 ( p_msg_name IN VARCHAR2
249 , p_msg_level IN NUMBER
250 , p_token1 IN VARCHAR2
251 , p_value1 IN VARCHAR2
252 , p_token2 IN VARCHAR2
253 , p_value2 IN VARCHAR2
254 , p_token3 IN VARCHAR2
255 , p_value3 IN VARCHAR2
256 , x_return_status OUT VARCHAR2
257 , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
258 );
259
260 --
261 -- these procedure check and puts the error message on the message stack
262 --
263 PROCEDURE Add_Error_Message
264 ( p_error_msg_name IN VARCHAR2
265 , p_error_msg_level IN NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR
266 , p_error_proc_name IN VARCHAR2 := NULL
267 , p_error_type IN VARCHAR2 := BIS_VG_UTIL.G_ERROR
268 , p_error_table IN BIS_VG_UTIL.Error_Tbl_Type
269 , x_error_table OUT BIS_VG_UTIL.Error_Tbl_Type
270 );
271
272 PROCEDURE Add_Error_Message
273 ( p_error_msg_name IN VARCHAR2
274 , p_error_msg_level IN NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR
275 , p_error_proc_name IN VARCHAR2 := NULL
276 , p_error_type IN VARCHAR2 := BIS_VG_UTIL.G_ERROR
277 , p_token1 IN VARCHAR2
278 , p_value1 IN VARCHAR2
279 , p_error_table IN BIS_VG_UTIL.Error_Tbl_Type
280 , x_error_table OUT BIS_VG_UTIL.Error_Tbl_Type
281 );
282
283 PROCEDURE Add_Error_Message
284 ( p_error_msg_name IN VARCHAR2
285 , p_error_msg_level IN NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR
286 , p_error_proc_name IN VARCHAR2 := NULL
287 , p_error_type IN VARCHAR2 := BIS_VG_UTIL.G_ERROR
288 , p_token1 IN VARCHAR2
289 , p_value1 IN VARCHAR2
290 , p_token2 IN VARCHAR2
291 , p_value2 IN VARCHAR2
292 , p_error_table IN BIS_VG_UTIL.Error_Tbl_Type
293 , x_error_table OUT BIS_VG_UTIL.Error_Tbl_Type
294 );
295
296 PROCEDURE Add_Error_Message
297 ( p_error_msg_name IN VARCHAR2
298 , p_error_msg_level IN NUMBER := FND_MSG_PUB.G_MSG_LVL_ERROR
299 , p_error_proc_name IN VARCHAR2 := NULL
300 , p_error_type IN VARCHAR2 := BIS_VG_UTIL.G_ERROR
301 , p_token1 IN VARCHAR2
302 , p_value1 IN VARCHAR2
303 , p_token2 IN VARCHAR2
304 , p_value2 IN VARCHAR2
305 , p_token3 IN VARCHAR2
306 , p_value3 IN VARCHAR2
307 , p_error_table IN BIS_VG_UTIL.Error_Tbl_Type
308 , x_error_table OUT BIS_VG_UTIL.Error_Tbl_Type
309 );
310
311 PROCEDURE Add_Error_Message
312 ( p_error_msg_id IN NUMBER := NULL
313 , p_error_msg_name IN VARCHAR2 := NULL
314 , p_error_description IN VARCHAR2 := NULL
315 , p_error_proc_name IN VARCHAR2 := NULL
316 , p_error_type IN VARCHAR2 := BIS_VG_UTIL.G_ERROR
317 , p_error_table IN BIS_VG_UTIL.Error_Tbl_Type
318 , x_error_table OUT BIS_VG_UTIL.Error_Tbl_Type
319 );
320
321 FUNCTION Find_Flex_Prompt(p_db_link IN VARCHAR2
322 , p_view_owner IN VARCHAR2
323 , p_view_name IN VARCHAR2
324 ,p_column_name IN VARCHAR2
325 , p_language IN VARCHAR2 )
326 RETURN VARCHAR2;
327
328 END BIS_VG_UTIL;