14: --
15: l_proc varchar2(72) := g_package||'return_api_dml_status';
16: --
17: Begin
18: hr_utility.set_location('Entering:'||l_proc, 5);
19: --
20: Return (nvl(g_api_dml, false));
21: --
22: hr_utility.set_location(' Leaving:'||l_proc, 10);
18: hr_utility.set_location('Entering:'||l_proc, 5);
19: --
20: Return (nvl(g_api_dml, false));
21: --
22: hr_utility.set_location(' Leaving:'||l_proc, 10);
23: End return_api_dml_status;
24: --
25: -- ----------------------------------------------------------------------------
26: -- |---------------------------< constraint_error >---------------------------|
30: --
31: l_proc varchar2(72) := g_package||'constraint_error';
32: --
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK1') Then
37: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK1') Then
37: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK1') Then
37: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
35: --
36: If (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK1') Then
37: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
36: If (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK1') Then
37: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
39: hr_utility.set_message_token('STEP','5');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
40: hr_utility.raise_error;
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
41: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_FK2') Then
42: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
43: hr_utility.set_message_token('PROCEDURE', l_proc);
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
44: hr_utility.set_message_token('STEP','10');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
45: hr_utility.raise_error;
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
46: ElsIf (p_constraint_name = 'BEN_PL_GD_OR_SVC_PK') Then
47: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.set_message_token('PROCEDURE', l_proc);
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55: hr_utility.raise_error;
56: End If;
49: hr_utility.set_message_token('STEP','15');
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55: hr_utility.raise_error;
56: End If;
57: --
50: hr_utility.raise_error;
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55: hr_utility.raise_error;
56: End If;
57: --
58: hr_utility.set_location(' Leaving:'||l_proc, 10);
51: Else
52: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53: hr_utility.set_message_token('PROCEDURE', l_proc);
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55: hr_utility.raise_error;
56: End If;
57: --
58: hr_utility.set_location(' Leaving:'||l_proc, 10);
59: End constraint_error;
54: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55: hr_utility.raise_error;
56: End If;
57: --
58: hr_utility.set_location(' Leaving:'||l_proc, 10);
59: End constraint_error;
60: --
61: -- ----------------------------------------------------------------------------
62: -- |-----------------------------< api_updating >-----------------------------|
123: l_proc varchar2(72) := g_package||'api_updating';
124: l_fct_ret boolean;
125: --
126: Begin
127: hr_utility.set_location('Entering:'||l_proc, 5);
128: --
129: If (p_effective_date is null or
130: p_pl_gd_or_svc_id is null or
131: p_object_version_number is null) Then
136: l_fct_ret := false;
137: Else
138: If (p_pl_gd_or_svc_id = g_old_rec.pl_gd_or_svc_id and
139: p_object_version_number = g_old_rec.object_version_number) Then
140: hr_utility.set_location(l_proc, 10);
141: --
142: -- The g_old_rec is current therefore we must
143: -- set the returning function to true
144: --
153: Close C_Sel1;
154: --
155: -- The primary key is invalid therefore we must error
156: --
157: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
158: hr_utility.raise_error;
159: End If;
160: Close C_Sel1;
161: If (p_object_version_number <> g_old_rec.object_version_number) Then
154: --
155: -- The primary key is invalid therefore we must error
156: --
157: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
158: hr_utility.raise_error;
159: End If;
160: Close C_Sel1;
161: If (p_object_version_number <> g_old_rec.object_version_number) Then
162: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
158: hr_utility.raise_error;
159: End If;
160: Close C_Sel1;
161: If (p_object_version_number <> g_old_rec.object_version_number) Then
162: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
163: hr_utility.raise_error;
164: End If;
165: hr_utility.set_location(l_proc, 15);
166: l_fct_ret := true;
159: End If;
160: Close C_Sel1;
161: If (p_object_version_number <> g_old_rec.object_version_number) Then
162: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
163: hr_utility.raise_error;
164: End If;
165: hr_utility.set_location(l_proc, 15);
166: l_fct_ret := true;
167: End If;
161: If (p_object_version_number <> g_old_rec.object_version_number) Then
162: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
163: hr_utility.raise_error;
164: End If;
165: hr_utility.set_location(l_proc, 15);
166: l_fct_ret := true;
167: End If;
168: End If;
169: hr_utility.set_location(' Leaving:'||l_proc, 20);
165: hr_utility.set_location(l_proc, 15);
166: l_fct_ret := true;
167: End If;
168: End If;
169: hr_utility.set_location(' Leaving:'||l_proc, 20);
170: Return (l_fct_ret);
171: --
172: End api_updating;
173: --
193: and p_effective_date
194: between t.effective_start_date and t.effective_end_date;
195: --
196: Begin
197: hr_utility.set_location('Entering:'||l_proc, 5);
198: Open C_Sel1;
199: Fetch C_Sel1 Into l_parent_key_value1;
200: If C_Sel1%notfound then
201: Close C_Sel1;
198: Open C_Sel1;
199: Fetch C_Sel1 Into l_parent_key_value1;
200: If C_Sel1%notfound then
201: Close C_Sel1;
202: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
203: hr_utility.set_message_token('PROCEDURE', l_proc);
204: hr_utility.set_message_token('STEP','10');
205: hr_utility.raise_error;
206: End If;
199: Fetch C_Sel1 Into l_parent_key_value1;
200: If C_Sel1%notfound then
201: Close C_Sel1;
202: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
203: hr_utility.set_message_token('PROCEDURE', l_proc);
204: hr_utility.set_message_token('STEP','10');
205: hr_utility.raise_error;
206: End If;
207: Close C_Sel1;
200: If C_Sel1%notfound then
201: Close C_Sel1;
202: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
203: hr_utility.set_message_token('PROCEDURE', l_proc);
204: hr_utility.set_message_token('STEP','10');
205: hr_utility.raise_error;
206: End If;
207: Close C_Sel1;
208: --
201: Close C_Sel1;
202: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
203: hr_utility.set_message_token('PROCEDURE', l_proc);
204: hr_utility.set_message_token('STEP','10');
205: hr_utility.raise_error;
206: End If;
207: Close C_Sel1;
208: --
209: -- Call the corresponding datetrack api
220: p_delete => p_delete,
221: p_future_change => p_future_change,
222: p_delete_next_change => p_delete_next_change);
223: --
224: hr_utility.set_location(' Leaving:'||l_proc, 10);
225: End find_dt_del_modes;
226: --
227: -- ----------------------------------------------------------------------------
228: -- |--------------------------< find_dt_upd_modes >---------------------------|
237: --
238: l_proc varchar2(72) := g_package||'find_dt_upd_modes';
239: --
240: Begin
241: hr_utility.set_location('Entering:'||l_proc, 5);
242: --
243: -- Call the corresponding datetrack api
244: --
245: dt_api.find_dt_upd_modes
251: p_update => p_update,
252: p_update_override => p_update_override,
253: p_update_change_insert => p_update_change_insert);
254: --
255: hr_utility.set_location(' Leaving:'||l_proc, 10);
256: End find_dt_upd_modes;
257: --
258: -- ----------------------------------------------------------------------------
259: -- |------------------------< upd_effective_end_date >------------------------|
269: l_proc varchar2(72) := g_package||'upd_effective_end_date';
270: l_object_version_number number;
271: --
272: Begin
273: hr_utility.set_location('Entering:'||l_proc, 5);
274: --
275: -- Because we are updating a row we must get the next object
276: -- version number.
277: --
280: (p_base_table_name => 'ben_pl_gd_or_svc_f',
281: p_base_key_column => 'pl_gd_or_svc_id',
282: p_base_key_value => p_base_key_value);
283: --
284: hr_utility.set_location(l_proc, 10);
285: g_api_dml := true; -- Set the api dml status
286: --
287: -- Update the specified datetrack row setting the effective
288: -- end date to the specified new effective end date.
295: between t.effective_start_date and t.effective_end_date;
296: --
297: g_api_dml := false; -- Unset the api dml status
298: p_object_version_number := l_object_version_number;
299: hr_utility.set_location(' Leaving:'||l_proc, 15);
300: --
301: Exception
302: When Others Then
303: g_api_dml := false; -- Unset the api dml status
377: --
378: --
379: --
380: Begin
381: hr_utility.set_location('Entering:'||l_proc, 5);
382: --
383: -- Ensure that all the mandatory arguments are not null
384: --
385: hr_api.mandatory_arg_error(p_api_name => l_proc,
410: Close C_Sel1;
411: --
412: -- The primary key is invalid therefore we must error
413: --
414: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
415: hr_utility.raise_error;
416: End If;
417: Close C_Sel1;
418: If (p_object_version_number <> g_old_rec.object_version_number) Then
411: --
412: -- The primary key is invalid therefore we must error
413: --
414: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
415: hr_utility.raise_error;
416: End If;
417: Close C_Sel1;
418: If (p_object_version_number <> g_old_rec.object_version_number) Then
419: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
415: hr_utility.raise_error;
416: End If;
417: Close C_Sel1;
418: If (p_object_version_number <> g_old_rec.object_version_number) Then
419: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
420: hr_utility.raise_error;
421: End If;
422: hr_utility.set_location(l_proc, 15);
423: --
416: End If;
417: Close C_Sel1;
418: If (p_object_version_number <> g_old_rec.object_version_number) Then
419: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
420: hr_utility.raise_error;
421: End If;
422: hr_utility.set_location(l_proc, 15);
423: --
424: --
418: If (p_object_version_number <> g_old_rec.object_version_number) Then
419: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
420: hr_utility.raise_error;
421: End If;
422: hr_utility.set_location(l_proc, 15);
423: --
424: --
425: -- Validate the datetrack mode mode getting the validation start
426: -- and end dates for the specified datetrack operation.
444: -- We are doing a datetrack 'INSERT' which is illegal within this
445: -- procedure therefore we must error (note: to lck on insert the
446: -- private procedure ins_lck should be called).
447: --
448: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
449: hr_utility.set_message_token('PROCEDURE', l_proc);
450: hr_utility.set_message_token('STEP','20');
451: hr_utility.raise_error;
452: End If;
445: -- procedure therefore we must error (note: to lck on insert the
446: -- private procedure ins_lck should be called).
447: --
448: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
449: hr_utility.set_message_token('PROCEDURE', l_proc);
450: hr_utility.set_message_token('STEP','20');
451: hr_utility.raise_error;
452: End If;
453: --
446: -- private procedure ins_lck should be called).
447: --
448: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
449: hr_utility.set_message_token('PROCEDURE', l_proc);
450: hr_utility.set_message_token('STEP','20');
451: hr_utility.raise_error;
452: End If;
453: --
454: -- Set the validation start and end date OUT arguments
447: --
448: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
449: hr_utility.set_message_token('PROCEDURE', l_proc);
450: hr_utility.set_message_token('STEP','20');
451: hr_utility.raise_error;
452: End If;
453: --
454: -- Set the validation start and end date OUT arguments
455: --
455: --
456: p_validation_start_date := l_validation_start_date;
457: p_validation_end_date := l_validation_end_date;
458: --
459: hr_utility.set_location(' Leaving:'||l_proc, 30);
460: --
461: -- We need to trap the ORA LOCK exception
462: --
463: Exception
465: --
466: -- The object is locked therefore we need to supply a meaningful
467: -- error message.
468: --
469: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
470: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
471: hr_utility.raise_error;
472: When l_object_invalid then
473: --
466: -- The object is locked therefore we need to supply a meaningful
467: -- error message.
468: --
469: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
470: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
471: hr_utility.raise_error;
472: When l_object_invalid then
473: --
474: -- The object doesn't exist or is invalid
467: -- error message.
468: --
469: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
470: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
471: hr_utility.raise_error;
472: When l_object_invalid then
473: --
474: -- The object doesn't exist or is invalid
475: --
472: When l_object_invalid then
473: --
474: -- The object doesn't exist or is invalid
475: --
476: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
477: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
478: hr_utility.raise_error;
479: End lck;
480: --
473: --
474: -- The object doesn't exist or is invalid
475: --
476: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
477: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
478: hr_utility.raise_error;
479: End lck;
480: --
481: -- ----------------------------------------------------------------------------
474: -- The object doesn't exist or is invalid
475: --
476: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
477: hr_utility.set_message_token('TABLE_NAME', 'ben_pl_gd_or_svc_f');
478: hr_utility.raise_error;
479: End lck;
480: --
481: -- ----------------------------------------------------------------------------
482: -- |-----------------------------< convert_args >-----------------------------|
533: l_proc varchar2(72) := g_package||'convert_args';
534: --
535: Begin
536: --
537: hr_utility.set_location('Entering:'||l_proc, 5);
538: --
539: -- Convert arguments into local l_rec structure.
540: --
541: l_rec.pl_gd_or_svc_id := p_pl_gd_or_svc_id;
584:
585: --
586: -- Return the plsql record structure.
587: --
588: hr_utility.set_location(' Leaving:'||l_proc, 10);
589: Return(l_rec);
590: --
591: End convert_args;
592: --