36: return number is
37: x number;
38: begin
39: -- check correct use of expiry checking and feed checking attributes
40: hr_utility.set_location('pay_db_balances_pkg.create_balance_dimension',10);
41: if (p_dimension_type = 'N'
42: and (p_feed_checking_code is not null
43: or p_feed_checking_type is not null
44: or p_expiry_checking_code is not null
53: or (p_dimension_type in ('A', 'P')
54: and ((p_expiry_checking_code is null and p_expiry_checking_level <> 'N')
55: or p_expiry_checking_level is null)) then
56:
57: hr_utility.set_message(801, 'HR_BAD_BALDIM_DATA');
58: hr_utility.raise_error;
59: end if;
60: --
61: -- check the database item suffix: it must only contain valid
54: and ((p_expiry_checking_code is null and p_expiry_checking_level <> 'N')
55: or p_expiry_checking_level is null)) then
56:
57: hr_utility.set_message(801, 'HR_BAD_BALDIM_DATA');
58: hr_utility.raise_error;
59: end if;
60: --
61: -- check the database item suffix: it must only contain valid
62: -- characters for a DB Item name
75: End If;
76:
77: -- do the insert
78:
79: hr_utility.set_location('pay_db_balances_pkg.create_balance_dimension',20);
80: insert into pay_balance_dimensions
81: (balance_dimension_id,
82: business_group_id,
83: legislation_code,
126: nvl(p_legislation_code, 'NULL')
127: );
128: --
129: if (SQL%rowcount > 0) then
130: hr_utility.set_location('pay_db_balances_pkg.create_balance_dimension',30);
131: select pay_balance_dimensions_s.currval
132: into x from dual;
133: return x;
134: else
156: l_run_dim_id number;
157: l_route_id number;
158: begin
159: if (not p_route_type in ('RR', 'SRB')) then
160: hr_utility.set_message(801, 'HR_BAD_BALDIM_DATA');
161: hr_utility.raise_error;
162: end if;
163: insert into pay_dimension_routes
164: (balance_dimension_id,
157: l_route_id number;
158: begin
159: if (not p_route_type in ('RR', 'SRB')) then
160: hr_utility.set_message(801, 'HR_BAD_BALDIM_DATA');
161: hr_utility.raise_error;
162: end if;
163: insert into pay_dimension_routes
164: (balance_dimension_id,
165: route_id,