1 package body EGO_REPORT_LISTS_PKG as
2 /* $Header: EGOURPLB.pls 120.0 2005/11/04 18:28 sshrikha noship $ */
3
4
5 PROCEDURE ADD_LANGUAGE
6 IS
7
8 BEGIN
9 delete from EGO_REPORT_LISTS_TL T
10 where not exists
11 (select NULL
12 from EGO_REPORT_LISTS_B B
13 where B.LIST_ID = T.LIST_ID
14 );
15
16 update EGO_REPORT_LISTS_TL T set (
17 LIST_NAME
18 ) = (select
19 B.LIST_NAME
20 from EGO_REPORT_LISTS_TL B
21 where B.LIST_ID = T.LIST_ID
22 and B.LANGUAGE = T.SOURCE_LANG)
23 where (
24 T.LIST_ID,
25 T.LANGUAGE
26 ) in (select
27 SUBT.LIST_ID,
28 SUBT.LANGUAGE
29 from EGO_REPORT_LISTS_TL SUBB, EGO_REPORT_LISTS_TL SUBT
30 where SUBB.LIST_ID = SUBT.LIST_ID
31 and SUBB.LANGUAGE = SUBT.SOURCE_LANG
32 and (SUBB.LIST_NAME <> SUBT.LIST_NAME
33 or (SUBB.LIST_NAME is null and SUBT.LIST_NAME is not null)
34 or (SUBB.LIST_NAME is not null and SUBT.LIST_NAME is null)
35 ));
36
37 insert into EGO_REPORT_LISTS_TL (
38 LIST_ID,
39 CREATION_DATE,
40 CREATED_BY,
41 LAST_UPDATE_DATE,
42 LAST_UPDATED_BY,
43 LAST_UPDATE_LOGIN,
44 LIST_NAME,
45 LANGUAGE,
46 SOURCE_LANG
47 ) select
48 B.LIST_ID,
49 B.CREATION_DATE,
50 B.CREATED_BY,
51 B.LAST_UPDATE_DATE,
52 B.LAST_UPDATED_BY,
53 B.LAST_UPDATE_LOGIN,
54 B.LIST_NAME,
55 L.LANGUAGE_CODE,
56 B.SOURCE_LANG
57 from EGO_REPORT_LISTS_TL B, FND_LANGUAGES L
58 where L.INSTALLED_FLAG in ('I', 'B')
59 and B.LANGUAGE = userenv('LANG')
60 and not exists
61 (select NULL
62 from EGO_REPORT_LISTS_TL T
63 where T.LIST_ID = B.LIST_ID
64 and T.LANGUAGE = L.LANGUAGE_CODE);
65
66 END ADD_LANGUAGE;
67
68 end EGO_REPORT_LISTS_PKG;