3:
4: procedure ADD_LANGUAGE
5: is
6: begin
7: delete from BIS_TARGET_LEVELS_TL T
8: where not exists
9: (select NULL
10: from BIS_TARGET_LEVELS B
11: where B.TARGET_LEVEL_ID = T.TARGET_LEVEL_ID
10: from BIS_TARGET_LEVELS B
11: where B.TARGET_LEVEL_ID = T.TARGET_LEVEL_ID
12: );
13:
14: update BIS_TARGET_LEVELS_TL T set (
15: NAME,
16: DESCRIPTION
17: ) = (select
18: B.NAME,
16: DESCRIPTION
17: ) = (select
18: B.NAME,
19: B.DESCRIPTION
20: from BIS_TARGET_LEVELS_TL B
21: where B.TARGET_LEVEL_ID = T.TARGET_LEVEL_ID
22: and B.LANGUAGE = T.SOURCE_LANG)
23: where (
24: T.TARGET_LEVEL_ID,
25: T.LANGUAGE
26: ) in (select
27: SUBT.TARGET_LEVEL_ID,
28: SUBT.LANGUAGE
29: from BIS_TARGET_LEVELS_TL SUBB, BIS_TARGET_LEVELS_TL SUBT
30: where SUBB.TARGET_LEVEL_ID = SUBT.TARGET_LEVEL_ID
31: and SUBB.LANGUAGE = SUBT.SOURCE_LANG
32: and (SUBB.NAME <> SUBT.NAME
33: or SUBB.DESCRIPTION <> SUBT.DESCRIPTION
34: or (SUBB.DESCRIPTION is null and SUBT.DESCRIPTION is not null)
35: or (SUBB.DESCRIPTION is not null and SUBT.DESCRIPTION is null)
36: ));
37:
38: insert into BIS_TARGET_LEVELS_TL (
39: TARGET_LEVEL_ID,
40: NAME,
41: DESCRIPTION,
42: CREATION_DATE,
56: B.LAST_UPDATED_BY,
57: B.LAST_UPDATE_LOGIN,
58: L.LANGUAGE_CODE,
59: B.SOURCE_LANG
60: from BIS_TARGET_LEVELS_TL B, FND_LANGUAGES L
61: where L.INSTALLED_FLAG in ('I', 'B')
62: and B.LANGUAGE = userenv('LANG')
63: and not exists
64: (select NULL
61: where L.INSTALLED_FLAG in ('I', 'B')
62: and B.LANGUAGE = userenv('LANG')
63: and not exists
64: (select NULL
65: from BIS_TARGET_LEVELS_TL T
66: where T.TARGET_LEVEL_ID = B.TARGET_LEVEL_ID
67: and T.LANGUAGE = L.LANGUAGE_CODE);
68:
69: end ADD_LANGUAGE;