1 PACKAGE BODY HR_OWNER_DEFINITIONS_PKG AS
2 /* $Header: pyowd01t.pkb 115.1 99/07/17 06:19:21 porting ship $ */
3 --
4 procedure check_unique ( p_rowid in varchar2,
5 p_session_id in number,
6 p_application_name in varchar2) is
7 cursor c1 is
8 select '1'
9 from hr_owner_definitions hod,
10 fnd_application_vl app
11 where hod.product_short_name = app.application_short_name
12 and upper(app.application_name) = upper(p_application_name)
13 and hod.session_id = p_session_id
14 and ( p_rowid is null or
15 ( p_rowid is not null and p_rowid <> hod.rowid ) ) ;
16 l_dummy varchar2(1) ;
17 begin
18 open c1 ;
19 fetch c1 into l_dummy ;
20 if c1%found
21 then close c1 ;
22 hr_utility.set_message(801,'HR_6661_OWNER_ALREADY_EXISTS');
23 hr_utility.raise_error ;
24 end if ;
25 close c1 ;
26 end check_unique ;
27 --
28
29 --
30 procedure insert_row(p_rowid in out varchar2,
31 p_session_id in number ,
32 p_product_short_name in varchar2 ) is
33 --
34 cursor c1 is
35 select rowid
36 from hr_owner_definitions
37 where session_id = p_session_id
38 and product_short_name = p_product_short_name ;
39 --
40 begin
41 --
42 insert into HR_OWNER_DEFINITIONS
43 ( SESSION_ID,
44 PRODUCT_SHORT_NAME )
45 values ( p_session_id,
46 p_product_short_name) ;
47 --
48 open c1 ;
49 fetch c1 into p_rowid ;
50 close c1 ;
51 --
52 end insert_row ;
53 --
54 procedure delete_row(p_rowid in varchar2) is
55 --
56 begin
57 --
58 delete from HR_OWNER_DEFINITIONS
59 where ROWID = p_rowid;
60 --
61 end delete_row;
62 --
63 END HR_OWNER_DEFINITIONS_PKG;