DBA Data[Home] [Help]

PACKAGE BODY: APPS.HRDPP_DELETE_BAL_TYPE

Source


1 package body hrdpp_DELETE_BAL_TYPE as
2 /*
3  * Generated by hr_pump_meta_mapper at: 2007/01/03 23:01:40
4  * Generated for API: PAY_BALANCE_TYPES_API.DELETE_BAL_TYPE
5  */
6 --
7 dh constant date := hr_api.g_date;
8 nh constant number := hr_api.g_number;
9 vh constant varchar2(64) := hr_api.g_varchar2;
10 c_sot constant date := to_date('01010001','DDMMYYYY');
11 cn constant varchar2(32) := '<NULL>';
12 dn constant date := null;
13 nn constant number := null;
14 vn constant varchar2(1) := null;
15 --
16 function dc(p in date) return varchar2 is
17 begin
18 if p<c_sot then
19  if p<>trunc(p) then
20   return to_char(p,'SYYYY/MM/DD HH24:MI:SS');
21  end if;
22  return to_char(p,'SYYYY/MM/DD');
23 elsif p<>trunc(p) then
24  return to_char(p,'YYYY/MM/DD HH24:MI:SS');
25 end if;
26 return to_char(p,'YYYY/MM/DD');
27 end dc;
28 function d(p in varchar2) return date is
29 begin
30 if length(p)=10 then
31 return to_date(p,'YYYY/MM/DD');
32 elsif length(p)=19 then
33 return to_date(p,'YYYY/MM/DD HH24:MI:SS');
34 elsif length(p)=11 then
35 return to_date(p,'SYYYY/MM/DD');
36 elsif length(p)=20 then
37 return to_date(p,'SYYYY/MM/DD HH24:MI:SS');
38 end if;
39 -- Try default format as last resort.
40 return to_date(p,'YYYY/MM/DD');
41 end d;
42 function n(p in varchar2) return number is
43 begin
44 return to_number(p);
45 end n;
46 function dd(p in date,i in varchar2)
47 return varchar2 is
48 begin
49 if upper(i) = 'N' then return dc(p);
50 else return cn; end if;
51 end dd;
52 function nd(p in number,i in varchar2)
53 return varchar2 is
54 begin
55 if upper(i) = 'N' then return to_char(p);
56 else return cn; end if;
57 end nd;
58 --
59 procedure iuk
60 (p_batch_line_id  in number,
61 p_user_key_value in varchar2,
62 p_unique_key_id  in number)
63 is
64 begin
65 hr_data_pump.entry('ins_user_key');
66 insert into hr_pump_batch_line_user_keys
67 (user_key_id, batch_line_id,user_key_value,unique_key_id)
68 values
69 (hr_pump_batch_line_user_keys_s.nextval,
70 p_batch_line_id,
71 p_user_key_value,
72 p_unique_key_id);
73 hr_data_pump.exit('ins_user_key');
74 end iuk;
75 --
76 procedure insert_batch_lines
77 (p_batch_id      in number
78 ,p_data_pump_batch_line_id in number default null
79 ,p_data_pump_business_grp_name in varchar2 default null
80 ,p_user_sequence in number default null
81 ,p_link_value    in number default null
82 ,P_BALANCE_TYPE_USER_KEY in varchar2) is
83 blid number := p_data_pump_batch_line_id;
84 begin
85 if blid is not null then
86 delete from hr_pump_batch_lines where batch_line_id = blid;
87 delete from hr_pump_batch_exceptions
88 where source_type = 'BATCH_LINE' and source_id = blid;
89 end if;
90 insert into hr_pump_batch_lines
91 (batch_id
92 ,batch_line_id
93 ,business_group_name
94 ,api_module_id
95 ,line_status
96 ,user_sequence
97 ,link_value
98 ,pval001)
99 values
100 (p_batch_id
101 ,nvl(blid,hr_pump_batch_lines_s.nextval)
102 ,p_data_pump_business_grp_name
103 ,3586
104 ,'U'
105 ,p_user_sequence
106 ,p_link_value
107 ,P_BALANCE_TYPE_USER_KEY);
108 end insert_batch_lines;
109 --
110 procedure call
111 (p_business_group_id in number,
112 p_batch_line_id     in number) is
113 cursor cr is
114 select l.rowid myrowid,
115 decode(l.pval001,cn,vn,l.pval001) p1
116 from hr_pump_batch_lines l
117 where l.batch_line_id = p_batch_line_id;
118 --
119 c cr%rowtype;
120 l_validate boolean := false;
121 L_BALANCE_TYPE_ID number;
122 L_OBJECT_VERSION_NUMBER number;
123 --
124 begin
125 hr_data_pump.entry('call');
126 open cr;
127 fetch cr into c;
128 if cr%notfound then
129 hr_utility.set_message(800,'HR_50326_DP_NO_ROW');
130 hr_utility.set_message_token('TABLE','HR_PUMP_BATCH_LINES');
131 hr_utility.set_message_token('COLUMN','P_BATCH_LINE_ID');
132 hr_utility.set_message_token('VALUE',p_batch_line_id);
133 hr_utility.raise_error;
134 end if;
135 --
136 if c.p1 is null then
137 L_BALANCE_TYPE_ID:=nn;
138 else
139 L_BALANCE_TYPE_ID := 
140 PAY_BALANCE_TYPES_DATA_PUMP.get_balance_type_id
141 (P_BALANCE_TYPE_USER_KEY => c.p1);
142 end if;
143 --
144 if c.p1 is null then
145 L_OBJECT_VERSION_NUMBER:=nn;
146 else
147 L_OBJECT_VERSION_NUMBER := 
148 PAY_BALANCE_TYPES_DATA_PUMP.GET_BALANCE_TYPE_OVN
149 (P_BALANCE_TYPE_USER_KEY => c.p1);
150 end if;
151 --
152 hr_data_pump.api_trc_on;
153 PAY_BALANCE_TYPES_API.DELETE_BAL_TYPE
154 (p_validate => l_validate
155 ,P_BALANCE_TYPE_ID => L_BALANCE_TYPE_ID
156 ,P_OBJECT_VERSION_NUMBER => L_OBJECT_VERSION_NUMBER);
157 hr_data_pump.api_trc_off;
158 
159 --
160 
161 --
162 close cr;
163 --
164 hr_data_pump.exit('call');
165 exception
166  when hr_multi_message.error_message_exist then
167    if cr%isopen then
168     close cr;
169    end if;
170    hr_pump_utils.set_multi_msg_error_flag(true);
171  when others then
172  if cr%isopen then
173   close cr;
174  end if;
175  raise;
176 end call;
177 end hrdpp_DELETE_BAL_TYPE;