1 PACKAGE BODY FA_CUA_HIERARCHY_VALUES_PKG AS
2 /* $Header: FACHRAAMB.pls 120.1 2002/11/12 07:54:45 glchen ship $ */
3
4 Procedure Insert_row ( x_rowid in out nocopy varchar2
5 , x_asset_hierarchy_id in out nocopy number
6 , x_book_type_code in varchar2
7 , x_asset_category_id in number
8 , x_lease_id in number
9 , x_asset_key_ccid in number
10 , x_serial_number in varchar2
11 , x_life_end_date in date
12 , x_dist_set_id in number
13 , X_CREATION_DATE in date
14 , X_CREATED_BY in number
15 , X_LAST_UPDATE_DATE in date
16 , X_LAST_UPDATED_BY in number
17 , X_LAST_UPDATE_LOGIN in number
18 )
19 is
20 Cursor C1 is Select ROWID from FA_ASSET_HIERARCHY_VALUES
21 where asset_hierarchy_id = x_asset_hierarchy_id
22 and book_type_code = x_book_type_code;
23 begin
24 insert into FA_ASSET_HIERARCHY_VALUES
25 ( asset_hierarchy_id
26 , book_type_code
27 , asset_category_id
28 , lease_id
29 , asset_key_ccid
30 , serial_number
31 , life_end_date
32 , dist_set_id
33 , CREATION_DATE
34 , CREATED_BY
35 , LAST_UPDATE_DATE
36 , LAST_UPDATED_BY
37 , LAST_UPDATE_LOGIN
38 ) Values
39 ( x_asset_hierarchy_id
40 , x_book_type_code
41 , x_asset_category_id
42 , x_lease_id
43 , x_asset_key_ccid
44 , x_serial_number
45 , x_life_end_date
46 , x_dist_set_id
47 , X_CREATION_DATE
48 , X_CREATED_BY
49 , X_LAST_UPDATE_DATE
50 , X_LAST_UPDATED_BY
51 , X_LAST_UPDATE_LOGIN
52 );
53
54 Open C1;
55 fetch C1 into x_rowid;
56 if (C1%NOTFOUND) then
57 close C1;
58 raise no_data_found;
59 end if;
60 close C1;
61 end INSERT_ROW;
62 procedure create_attribute(
63 -- Arguments required for Public APIs
64 x_err_code out nocopy Varchar2
65 , x_err_stage out nocopy Varchar2
66 , x_err_stack out nocopy varchar2
67 -- Arguments for Node Creation
68 , x_asset_hierarchy_id in out nocopy number
69 , x_book_type_code in varchar2
70 , x_asset_category_id in number
71 , x_lease_id in number
72 , x_asset_key_ccid in number
73 , x_serial_number in varchar2
74 , x_life_end_date in date
75 , X_CREATION_DATE in date
76 , X_CREATED_BY in number
77 , X_LAST_UPDATE_DATE in date
78 , X_LAST_UPDATED_BY in number
79 , X_LAST_UPDATE_LOGIN in number
80 )
81 is
82 begin
83 null;
84 end create_attribute;
85
86 procedure LOCK_ROW ( x_rowid in varchar2
87 , x_asset_hierarchy_id in NUMBER
88 , x_book_type_code in varchar2
89 , x_asset_category_id in number
90 , x_lease_id in number
91 , x_asset_key_ccid in number
92 , x_serial_number in varchar2
93 , x_life_end_date in date
94 , x_dist_set_id in number
95 )
96 is
97 Cursor C1 is
98 Select book_type_code
99 , asset_category_id
100 , lease_id
101 , asset_key_ccid
102 , serial_number
103 , life_end_date
104 , dist_set_id
105 from FA_ASSET_HIERARCHY_VALUES
106 where rowid = x_rowid
107 for update nowait;
108 tlinfo C1%ROWTYPE;
109 begin
110 open C1;
111 fetch c1 into tlinfo;
112 if (c1%notfound) then
113 fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
114 app_exception.raise_exception;
115 close c1;
116 return;
117 end if;
118 close c1;
119 if (
120 (tlinfo.book_type_code = x_book_type_code)
121 AND ((tlinfo.asset_category_id = x_asset_category_id)
122 OR ((tlinfo.asset_category_id is null)
123 AND (x_asset_category_id is null)))
124 AND ((tlinfo.lease_id = X_lease_id)
125 OR ((tlinfo.lease_id is null)
126 AND (X_lease_id is null)))
127 AND ((tlinfo.asset_key_ccid = X_asset_key_ccid)
128 OR ((tlinfo.asset_key_ccid is null)
129 AND (X_asset_key_ccid is null)))
130 AND ((tlinfo.serial_number = X_serial_number)
131 OR ((tlinfo.serial_number is null)
132 AND (X_serial_number is null)))
133 AND ((tlinfo.life_end_date = X_life_end_date)
134 OR ((tlinfo.life_end_date is null)
135 AND (X_life_end_date is null)))
136 AND ((tlinfo.dist_set_id = X_dist_set_id)
137 OR ((tlinfo.dist_set_id is null)
138 AND (X_dist_set_id is null)))
139 ) then
140 null;
141 else
142 fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
143 app_exception.raise_exception;
144 end if;
145 return;
146 end LOCK_ROW;
147
148 procedure UPDATE_ROW (
149 x_rowid in varchar2
150 , x_book_type_code in varchar2
151 , x_asset_category_id in number
152 , x_lease_id in number
153 , x_asset_key_ccid in number
154 , x_serial_number in varchar2
155 , x_life_end_date in date
156 , x_dist_set_id in number
157 , X_LAST_UPDATE_DATE in date
158 , X_LAST_UPDATED_BY in number
159 , X_LAST_UPDATE_LOGIN in number
160 )
161 is
162 begin
163 update FA_ASSET_HIERARCHY_VALUES
164 set book_type_code = x_book_type_code
165 , asset_category_id = x_asset_category_id
166 , lease_id = x_lease_id
167 , asset_key_ccid = x_asset_key_ccid
168 , serial_number = x_serial_number
169 , life_end_date = x_life_end_date
170 , dist_set_id = x_dist_set_id
171 , LAST_UPDATE_DATE = X_LAST_UPDATE_DATE
172 , LAST_UPDATED_BY = X_LAST_UPDATED_BY
173 , LAST_UPDATE_LOGIN = X_LAST_UPDATE_LOGIN
174 where rowid = x_rowid;
175 if (sql%notfound) then
176 raise no_data_found;
177 end if;
178 end UPDATE_ROW;
179
180 procedure DELETE_ROW (
181 x_rowid in VARCHAR2
182 )
183 is
184 begin
185 delete from FA_ASSET_HIERARCHY_VALUES
186 where rowid = x_rowid;
187 if (sql%notfound) then
188 raise no_data_found;
189 end if;
190 end DELETE_ROW;
191
192
193 end FA_CUA_HIERARCHY_VALUES_PKG ;