1 PACKAGE BODY BSC_COLOR_REPOSITORY AS
2 /* $Header: BSCRCOLB.pls 120.0.12000000.1 2007/07/17 07:44:22 appldev noship $ */
3
4
5 /* This function should be used by all clients who want to keep an object
6 * for color properties in the system. It gives back the cached object
7 * instead of querying db everytime.
8 */
9 FUNCTION get_color_props
10 RETURN t_array_colors
11 IS
12 CURSOR c_color IS
13 SELECT color_id, short_name, perf_sequence, user_numeric_equivalent
14 FROM bsc_sys_colors_b;
15
16 l_array_colors t_array_colors;
17 l_color_rec t_color_rec;
18 l_color_index NUMBER := 0;
19
20 BEGIN
21
22 IF G_COLOR_SET THEN
23
24 l_array_colors := g_array_colors;
25
26 ELSE
27
28 FOR l_color_rec IN c_color LOOP
29
30 l_color_index := l_color_index + 1;
31 l_array_colors(l_color_index) := l_color_rec;
32
33 END LOOP;
34
35 g_array_colors := l_array_colors;
36 G_COLOR_SET := TRUE;
37
38 END IF;
39
40 RETURN l_array_colors;
41
42 EXCEPTION
43 WHEN OTHERS THEN
44 BSC_MESSAGE.Add(x_message => SQLERRM,
45 x_source => 'BSC_COLOR_REPOSITORY.get_color_props');
46 RETURN l_array_colors;
47 END get_color_props;
48
49
50
51 END BSC_COLOR_REPOSITORY;