1 PACKAGE BODY PAY_BACKPAY_SETS_PKG AS
2 /* $Header: pybks01t.pkb 115.1 99/07/17 05:45:47 porting ship $ */
3 -----------------------------------------------------------------------------
4 -----------------------------------------------------------------------------
5 procedure check_name_uniqueness(
6 p_bus_grp_id number,
7 p_set_name varchar2,
8 p_set_id number) is
9 l_null varchar2(1);
10 --
11 -- Check that backpay set name is unique within business group.
12 -- Error if it is not.
13 --
14 begin
15 if p_set_id is not null then
16 --
17 -- Updating.
18 --
19 begin
20 select null
21 into l_null
22 from sys.dual
23 where not exists (
24 select null
25 from pay_backpay_sets s
26 where s.business_group_id + 0 = P_BUS_GRP_ID
27 and s.backpay_set_name = P_SET_NAME
28 and s.backpay_set_id <> P_SET_ID);
29 exception
30 when NO_DATA_FOUND then
31 fnd_message.set_name('PAY',
32 'PAY_7883_USER_TABLE_UNIQUE');
33 fnd_message.raise_error;
34 end;
35 else
36 --
37 -- Inserting.
38 --
39 begin
40 select null
41 into l_null
42 from sys.dual
43 where not exists (
44 select null
45 from pay_backpay_sets s
46 where s.business_group_id + 0 = P_BUS_GRP_ID
47 and s.backpay_set_name = P_SET_NAME);
48 exception
49 when NO_DATA_FOUND then
50 fnd_message.set_name('PAY',
51 'PAY_7883_USER_TABLE_UNIQUE');
52 fnd_message.raise_error;
53 end;
54 end if;
55 --
56 end check_name_uniqueness;
57 -----------------------------------------------------------------------------
58 END PAY_BACKPAY_SETS_PKG;