DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_SEED_ACTION_ITEM_TYPES

Source


1 package body ben_seed_action_item_types as
2 /* $Header: benactse.pkb 120.0.12010000.2 2008/08/05 14:30:48 ubhat ship $ */
3 --------------------------------------------------------------------------------
4 /*
5 +==============================================================================+
6 |			Copyright (c) 1997 Oracle Corporation		       |
7 |			   Redwood Shores, California, USA		       |
8 |			        All rights reserved.			       |
9 +==============================================================================+
10 --
11 Name
12 	Seed Action Item Types
13 Purpose
14         This package is used to seed action item types on a business group
15         basis.
16 History
17         Date             Who        Version    What?
18         ----             ---        -------    -----
19         18 Jun 98        S Tee      110.0      Created.
20         08 Jul 99        TMathers   115.1      Uses seed tables now.
21         12 May 00        S Tee      115.2      Insert into MLS table.
22         18 Feb 02        gsheelum   115.3      Removed description from
23                                                 not_exists clause.
24                                                Fixing 2217566.
25 */
26 --------------------------------------------------------------------------------
27 --
28 g_package varchar2(80) := 'ben_seed_action_item_types';
29 --
30 --
31 procedure seed_action_item_types(p_business_group_id in number) is
32   --
33   l_package               varchar2(80) := g_package||'.seed_action_item_types';
34   --
35 begin
36   --
37   hr_utility.set_location ('Entering '||l_package,10);
38   --
39   --
40     insert into ben_actn_typ
41     (actn_typ_id,
42      business_group_id,
43      type_cd,
44      name,
45      description,
46      object_version_number)
47     select
48      ben_actn_typ_s.nextval,
49      p_business_group_id,
50      s_at.type_cd,
51      s_at.name,
52      s_at.description,
53      1
54      from ben_startup_actn_typ s_at
55      where not exists (select 'Y'
56                       from ben_actn_typ act
57                       where s_at.type_cd        = act.type_cd
58                       and   s_at.name           = act.name
59                       -- and   s_at.description    = act.description
60                       and   p_business_group_id = act.business_group_id);
61    --
62    --  Also insert into MLS table.
63    --
64   insert into ben_actn_typ_tl (
65     actn_typ_id,
66     name,
67     description,
68     language,
69     type_cd,
70     source_lang,
71     last_update_date,
72     last_updated_by,
73     last_update_login,
74     created_by,
75     creation_date
76   ) select
77     b.actn_typ_id,
78     tl.name,
79     tl.description,
80     tl.language,
81     tl.type_cd,
82     tl.source_lang,
83     b.last_update_date,
84     b.last_updated_by,
85     b.last_update_login,
86     b.created_by,
87     b.creation_date
88   from ben_actn_typ b,
89        ben_startup_actn_typ_tl tl
90   where b.business_group_id = p_business_group_id
91   and b.type_cd = tl.type_cd
92   and not exists
93             (select 'Y'
94              from ben_actn_typ_tl t
95              where t.actn_typ_id = b.actn_typ_id
96              and   t.source_lang = userenv('LANG'));
97   --
98   hr_utility.set_location ('Leaving '||l_package,10);
99   --
100 end seed_action_item_types;
101 --
102 end ben_seed_action_item_types;