DBA Data[Home] [Help]

PACKAGE BODY: APPS.IEU_WP_UI_COMP_DATATYPES_PKG

Source


1 package body IEU_WP_UI_COMP_DATATYPES_PKG as
2 /* $Header: IEUVCDTB.pls 120.1 2005/06/20 01:06:21 appldev ship $ */
3 
4 procedure insert_row(
5 x_rowid in out nocopy Varchar2,
6 p_ui_comp_datatype_map_id in number,
7 p_ui_comp_id in number,
8 p_object_version_number in number,
9 p_created_by in number,
10 p_creation_date in date,
11 p_last_updated_by in number,
12 p_last_update_date in date,
13 p_last_update_login in number,
14 p_data_type in varchar2
15 ) is
16   cursor C is select ROWID from IEU_WP_UI_COMP_DATATYPES
17     where UI_COMP_DATATYPE_MAP_ID = P_UI_COMP_DATATYPE_MAP_ID;
18 
19 begin
20   insert into IEU_WP_UI_COMP_DATATYPES (
21   UI_COMP_DATATYPE_MAP_ID,
22   UI_COMP_ID ,
23   OBJECT_VERSION_NUMBER,
24   CREATED_BY,
25   CREATION_DATE,
26   LAST_UPDATED_BY,
27   LAST_UPDATE_DATE,
28   LAST_UPDATE_LOGIN,
29   DATA_TYPE
30  )
31   VALUES(
32   p_ui_comp_datatype_map_id,
33   p_ui_comp_id,
34   p_object_version_number,
35   p_created_by,
36   p_creation_date,
37   p_last_updated_by,
38   p_last_update_date,
39   p_last_update_login,
40   p_data_type
41   );
42 
43   open c;
44   fetch c into x_rowid;
45   if (c%notfound) then
46     close c;
47     raise no_data_found;
48   end if;
49   close c;
50 
51 END INSERT_ROW;
52 
53 
54 procedure lock_row(
55 p_ui_comp_datatype_map_id in number,
56 p_ui_comp_id in number,
57 p_object_version_number in number,
58 p_data_type in varchar2
59 ) is
60 cursor c is select
61   object_version_number,
62   data_type
63   from ieu_wp_ui_comp_datatypes
64   where ui_comp_datatype_map_id = p_ui_comp_datatype_map_id
65   for update of ui_comp_datatype_map_id nowait;
66 recinfo c%rowtype;
67 
68 begin
69   open c;
70   fetch c into recinfo;
71   if (c%notfound) then
72     close c;
73     fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
74     app_exception.raise_exception;
75   end if;
76   close c;
77 
78   if ((recinfo.object_version_number = p_object_version_number)
79       AND(recinfo.data_type = p_data_type))
80   then
81     null;
82   else
83     fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
84     app_exception.raise_exception;
85   end if;
86 
87 END LOCK_ROW;
88 
89 procedure update_row(
90 p_ui_comp_datatype_map_id in number,
91 p_ui_comp_id in number,
92 p_last_updated_by in number,
93 p_last_update_date in date,
94 p_last_update_login in number,
95 p_data_type in varchar2
96 ) is
97 begin
98    update IEU_WP_UI_COMP_DATATYPES set
99    object_version_number = object_version_number+1,
100    data_type = p_data_type,
101    ui_comp_id = p_ui_comp_id,
102    last_update_date = p_last_update_date,
103    last_updated_by = p_last_updated_by,
104    last_update_login = p_last_update_login
105    where ui_comp_datatype_map_id = p_ui_comp_datatype_map_id;
106 
107    if (sql%notfound) then
108       raise no_data_found;
109    end if;
110 
111    if (sql%notfound) then
112       raise no_data_found;
113    end if;
114 
115 END UPDATE_ROW;
116 
117 
118 procedure delete_row(
119 p_ui_comp_datatype_map_id in number
120 ) is
121 begin
122   delete from IEU_WP_UI_COMP_DATATYPES
123   where ui_comp_datatype_map_id = p_ui_comp_datatype_map_id;
124 
125   if (sql%notfound) then
126      raise no_data_found;
127   end if;
128 
129 END DELETE_ROW;
130 
131 
132 
133 procedure load_row(
134 p_ui_comp_datatype_map_id in number,
135 p_ui_comp_id in number,
136 p_data_type in varchar2,
137 p_owner in varchar2
138 ) is
139 
140   l_user_id number := 0;
141   l_rowid varchar2(50);
142 
143 begin
144   if (p_owner = 'SEED') then
145      l_user_id := 1;
146   end if;
147 
148   begin
149      update_row(
150      p_ui_comp_datatype_map_id => p_ui_comp_datatype_map_id,
151      p_ui_comp_id => p_ui_comp_id,
152      --p_last_updated_by => l_user_id,
153      p_last_updated_by => fnd_load_util.owner_id(p_owner),
154      p_last_update_date => sysdate,
155      p_last_update_login => 0,
156      p_data_type => p_data_type
157      );
158 
159      if (sql%notfound) then
160         raise no_data_found;
161      end if;
162 
163    exception when no_data_found then
164      insert_row(
165       x_rowid => l_rowid,
166       p_ui_comp_datatype_map_id => p_ui_comp_datatype_map_id,
167       p_ui_comp_id => p_ui_comp_id,
168       p_object_version_number => 1,
169       --p_created_by => l_user_id,
170       p_created_by => fnd_load_util.owner_id(p_owner),
171       p_creation_date => sysdate,
172       --p_last_updated_by => l_user_id,
173       p_last_updated_by => fnd_load_util.owner_id(p_owner),
174       p_last_update_date => sysdate,
175       p_last_update_login => 0,
176       p_data_type => p_data_type
177       );
178   end;
179 
180 END LOAD_ROW;
181 
182 procedure load_seed_row(
183 p_upload_mode in varchar2,
184 p_ui_comp_datatype_map_id in number,
185 p_ui_comp_id in number,
186 p_data_type in varchar2,
187 p_owner in varchar2
188 ) is
189 begin
190 
191 if (p_upload_mode = 'NLS') then
192   NULL;
193 else
194   load_row(
195     p_ui_comp_datatype_map_id,
196     p_ui_comp_id,
197     p_data_type,
198     p_owner);
199 end if;
200 
201 end load_seed_row;
202 
203 END IEU_WP_UI_COMP_DATATYPES_PKG;