381: Procedure add_language
382: is
383: begin
384:
385: delete from BEN_RPTG_GRP_TL T
386: where not exists
387: (select NULL
388: from BEN_RPTG_GRP B
389: where B.RPTG_GRP_ID = T.RPTG_GRP_ID
388: from BEN_RPTG_GRP B
389: where B.RPTG_GRP_ID = T.RPTG_GRP_ID
390: );
391:
392: update ben_rptg_grp_tl t set (
393: function_code,
394: name
395: ) = (select
396: b.function_code,
394: name
395: ) = (select
396: b.function_code,
397: b.name
398: from ben_rptg_grp_tl b
399: where b.RPTG_GRP_ID = t.RPTG_GRP_ID
400: and b.language = t.source_lang)
401: where (
402: t.RPTG_GRP_ID,
403: t.language
404: ) in (select
405: subt.RPTG_GRP_ID,
406: subt.language
407: from ben_rptg_grp_tl subb, ben_rptg_grp_tl subt
408: where subb.RPTG_GRP_ID = subt.RPTG_GRP_ID
409: and subb.language = subt.source_lang
410: and (subb.name <> subt.name
411: or subb.function_code <> subt.function_code
410: and (subb.name <> subt.name
411: or subb.function_code <> subt.function_code
412: ));
413:
414: insert into ben_rptg_grp_tl (
415: RPTG_GRP_ID,
416: function_code,
417: name,
418: language,
432: b.last_updated_by,
433: b.last_update_login,
434: b.created_by,
435: b.creation_date
436: from ben_rptg_grp_tl b, fnd_languages l
437: where l.installed_flag in ('I', 'B')
438: and b.language = userenv('LANG')
439: and not exists
440: (select null
437: where l.installed_flag in ('I', 'B')
438: and b.language = userenv('LANG')
439: and not exists
440: (select null
441: from ben_rptg_grp_tl t
442: where t.rptg_grp_id = b.rptg_grp_id
443: and t.language = l.language_code);
444: end add_language;
445: --