15: --
16: l_proc varchar2(72) := g_package||'constraint_error';
17: --
18: Begin
19: hr_utility.set_location('Entering:'||l_proc, 5);
20: --
21: If (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK1') Then
22: hr_utility.set_message(801, 'HR_52361_PTU_INVALID_PERSON_ID');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
18: Begin
19: hr_utility.set_location('Entering:'||l_proc, 5);
20: --
21: If (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK1') Then
22: hr_utility.set_message(801, 'HR_52361_PTU_INVALID_PERSON_ID');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
19: hr_utility.set_location('Entering:'||l_proc, 5);
20: --
21: If (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK1') Then
22: hr_utility.set_message(801, 'HR_52361_PTU_INVALID_PERSON_ID');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
20: --
21: If (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK1') Then
22: hr_utility.set_message(801, 'HR_52361_PTU_INVALID_PERSON_ID');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
21: If (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK1') Then
22: hr_utility.set_message(801, 'HR_52361_PTU_INVALID_PERSON_ID');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
23: hr_utility.set_message_token('PROCEDURE', l_proc);
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
24: hr_utility.set_message_token('STEP','10');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
25: hr_utility.raise_error;
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
26: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_UK1') Then
27: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
28: hr_utility.set_message_token('PROCEDURE', l_proc);
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
29: hr_utility.set_message_token('STEP','15');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
30: hr_utility.raise_error;
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
31: elsif (p_constraint_name = 'PER_PERSON_TYPE_USAGES_F_FK2') Then
32: hr_utility.set_message(801, 'HR_52362_PTU_INV_PER_TYPE_ID');
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
33: hr_utility.set_message_token('PROCEDURE', l_proc);
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40: hr_utility.raise_error;
41: End If;
34: hr_utility.set_message_token('STEP','20');
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40: hr_utility.raise_error;
41: End If;
42: --
35: hr_utility.raise_error;
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40: hr_utility.raise_error;
41: End If;
42: --
43: hr_utility.set_location(' Leaving:'||l_proc, 10);
36: Else
37: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.set_message_token('PROCEDURE', l_proc);
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40: hr_utility.raise_error;
41: End If;
42: --
43: hr_utility.set_location(' Leaving:'||l_proc, 10);
44: End constraint_error;
39: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40: hr_utility.raise_error;
41: End If;
42: --
43: hr_utility.set_location(' Leaving:'||l_proc, 10);
44: End constraint_error;
45: --
46: -- ----------------------------------------------------------------------------
47: -- |-----------------------------< api_updating >-----------------------------|
106: l_proc varchar2(72) := g_package||'api_updating';
107: l_fct_ret boolean;
108: --
109: Begin
110: hr_utility.set_location('Entering:'||l_proc, 5);
111: --
112: If (p_effective_date is null or
113: p_person_type_usage_id is null or
114: p_object_version_number is null) Then
119: l_fct_ret := false;
120: Else
121: If (p_person_type_usage_id = g_old_rec.person_type_usage_id and
122: p_object_version_number = g_old_rec.object_version_number) Then
123: hr_utility.set_location(l_proc, 10);
124: --
125: -- The g_old_rec is current therefore we must
126: -- set the returning function to true
127: --
136: Close C_Sel1;
137: --
138: -- The primary key is invalid therefore we must error
139: --
140: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
141: hr_utility.raise_error;
142: End If;
143: Close C_Sel1;
144: If (p_object_version_number <> g_old_rec.object_version_number) Then
137: --
138: -- The primary key is invalid therefore we must error
139: --
140: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
141: hr_utility.raise_error;
142: End If;
143: Close C_Sel1;
144: If (p_object_version_number <> g_old_rec.object_version_number) Then
145: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
141: hr_utility.raise_error;
142: End If;
143: Close C_Sel1;
144: If (p_object_version_number <> g_old_rec.object_version_number) Then
145: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
146: hr_utility.raise_error;
147: End If;
148: hr_utility.set_location(l_proc, 15);
149: l_fct_ret := true;
142: End If;
143: Close C_Sel1;
144: If (p_object_version_number <> g_old_rec.object_version_number) Then
145: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
146: hr_utility.raise_error;
147: End If;
148: hr_utility.set_location(l_proc, 15);
149: l_fct_ret := true;
150: End If;
144: If (p_object_version_number <> g_old_rec.object_version_number) Then
145: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
146: hr_utility.raise_error;
147: End If;
148: hr_utility.set_location(l_proc, 15);
149: l_fct_ret := true;
150: End If;
151: End If;
152: hr_utility.set_location(' Leaving:'||l_proc, 20);
148: hr_utility.set_location(l_proc, 15);
149: l_fct_ret := true;
150: End If;
151: End If;
152: hr_utility.set_location(' Leaving:'||l_proc, 20);
153: Return (l_fct_ret);
154: --
155: End api_updating;
156: --
177: and ptu.effective_end_date;
178: --
179: --
180: Begin
181: hr_utility.set_location('Entering:'||l_proc, 5);
182: Open C_Sel1;
183: Fetch C_Sel1 Into l_parent_key_value1;
184: If C_Sel1%notfound then
185: Close C_Sel1;
182: Open C_Sel1;
183: Fetch C_Sel1 Into l_parent_key_value1;
184: If C_Sel1%notfound then
185: Close C_Sel1;
186: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
187: hr_utility.set_message_token('PROCEDURE', l_proc);
188: hr_utility.set_message_token('STEP','10');
189: hr_utility.raise_error;
190: End If;
183: Fetch C_Sel1 Into l_parent_key_value1;
184: If C_Sel1%notfound then
185: Close C_Sel1;
186: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
187: hr_utility.set_message_token('PROCEDURE', l_proc);
188: hr_utility.set_message_token('STEP','10');
189: hr_utility.raise_error;
190: End If;
191: Close C_Sel1;
184: If C_Sel1%notfound then
185: Close C_Sel1;
186: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
187: hr_utility.set_message_token('PROCEDURE', l_proc);
188: hr_utility.set_message_token('STEP','10');
189: hr_utility.raise_error;
190: End If;
191: Close C_Sel1;
192: --
185: Close C_Sel1;
186: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
187: hr_utility.set_message_token('PROCEDURE', l_proc);
188: hr_utility.set_message_token('STEP','10');
189: hr_utility.raise_error;
190: End If;
191: Close C_Sel1;
192: --
193: -- Call the corresponding datetrack api
236: end if;
237: end if;
238: --
239: --
240: hr_utility.set_location(' Leaving:'||l_proc, 10);
241: End find_dt_del_modes;
242: --
243: -- ----------------------------------------------------------------------------
244: -- |--------------------------< find_dt_upd_modes >---------------------------|
253: --
254: l_proc varchar2(72) := g_package||'find_dt_upd_modes';
255: --
256: Begin
257: hr_utility.set_location('Entering:'||l_proc, 5);
258: --
259: -- Call the corresponding datetrack api
260: --
261: dt_api.find_dt_upd_modes
292: end if;
293: end if;
294: --
295:
296: hr_utility.set_location(' Leaving:'||l_proc, 10);
297: End find_dt_upd_modes;
298: --
299: -- ----------------------------------------------------------------------------
300: -- |------------------------< upd_effective_end_date >------------------------|
329: -- End of Fix for WWBUG 1408379
330: --
331: --
332: Begin
333: hr_utility.set_location('Entering:'||l_proc, 5);
334: --
335: -- Because we are updating a row we must get the next object
336: -- version number.
337: --
340: (p_base_table_name => 'per_person_type_usages_f',
341: p_base_key_column => 'person_type_usage_id',
342: p_base_key_value => p_base_key_value);
343: --
344: hr_utility.set_location(l_proc, 10);
345: --
346: --
347: -- Start of Fix for WWBUG 1408379
348: --
390: --
391: -- End of Fix for WWBUG 1408379
392: --
393: p_object_version_number := l_object_version_number;
394: hr_utility.set_location(' Leaving:'||l_proc, 15);
395: --
396: Exception
397: When Others Then
398: Raise;
469: --
470: --
471: --
472: Begin
473: hr_utility.set_location('Entering:'||l_proc, 5);
474: --
475: -- Ensure that all the mandatory arguments are not null
476: --
477: hr_api.mandatory_arg_error(p_api_name => l_proc,
502: Close C_Sel1;
503: --
504: -- The primary key is invalid therefore we must error
505: --
506: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
507: hr_utility.raise_error;
508: End If;
509: Close C_Sel1;
510: If (p_object_version_number <> g_old_rec.object_version_number) Then
503: --
504: -- The primary key is invalid therefore we must error
505: --
506: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
507: hr_utility.raise_error;
508: End If;
509: Close C_Sel1;
510: If (p_object_version_number <> g_old_rec.object_version_number) Then
511: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
507: hr_utility.raise_error;
508: End If;
509: Close C_Sel1;
510: If (p_object_version_number <> g_old_rec.object_version_number) Then
511: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
512: hr_utility.raise_error;
513: End If;
514: hr_utility.set_location(l_proc, 15);
515: --
508: End If;
509: Close C_Sel1;
510: If (p_object_version_number <> g_old_rec.object_version_number) Then
511: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
512: hr_utility.raise_error;
513: End If;
514: hr_utility.set_location(l_proc, 15);
515: --
516: --
510: If (p_object_version_number <> g_old_rec.object_version_number) Then
511: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
512: hr_utility.raise_error;
513: End If;
514: hr_utility.set_location(l_proc, 15);
515: --
516: --
517: -- Validate the datetrack mode mode getting the validation start
518: -- and end dates for the specified datetrack operation.
534: -- We are doing a datetrack 'INSERT' which is illegal within this
535: -- procedure therefore we must error (note: to lck on insert the
536: -- private procedure ins_lck should be called).
537: --
538: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
539: hr_utility.set_message_token('PROCEDURE', l_proc);
540: hr_utility.set_message_token('STEP','20');
541: hr_utility.raise_error;
542: End If;
535: -- procedure therefore we must error (note: to lck on insert the
536: -- private procedure ins_lck should be called).
537: --
538: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
539: hr_utility.set_message_token('PROCEDURE', l_proc);
540: hr_utility.set_message_token('STEP','20');
541: hr_utility.raise_error;
542: End If;
543: --
536: -- private procedure ins_lck should be called).
537: --
538: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
539: hr_utility.set_message_token('PROCEDURE', l_proc);
540: hr_utility.set_message_token('STEP','20');
541: hr_utility.raise_error;
542: End If;
543: --
544: -- Set the validation start and end date OUT arguments
537: --
538: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
539: hr_utility.set_message_token('PROCEDURE', l_proc);
540: hr_utility.set_message_token('STEP','20');
541: hr_utility.raise_error;
542: End If;
543: --
544: -- Set the validation start and end date OUT arguments
545: --
545: --
546: p_validation_start_date := l_validation_start_date;
547: p_validation_end_date := l_validation_end_date;
548: --
549: hr_utility.set_location(' Leaving:'||l_proc, 30);
550: --
551: -- We need to trap the ORA LOCK exception
552: --
553: Exception
555: --
556: -- The object is locked therefore we need to supply a meaningful
557: -- error message.
558: --
559: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
560: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
561: hr_utility.raise_error;
562: When l_object_invalid then
563: --
556: -- The object is locked therefore we need to supply a meaningful
557: -- error message.
558: --
559: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
560: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
561: hr_utility.raise_error;
562: When l_object_invalid then
563: --
564: -- The object doesn't exist or is invalid
557: -- error message.
558: --
559: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
560: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
561: hr_utility.raise_error;
562: When l_object_invalid then
563: --
564: -- The object doesn't exist or is invalid
565: --
562: When l_object_invalid then
563: --
564: -- The object doesn't exist or is invalid
565: --
566: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
567: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
568: hr_utility.raise_error;
569: End lck;
570: --
563: --
564: -- The object doesn't exist or is invalid
565: --
566: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
567: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
568: hr_utility.raise_error;
569: End lck;
570: --
571: -- ----------------------------------------------------------------------------
564: -- The object doesn't exist or is invalid
565: --
566: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
567: hr_utility.set_message_token('TABLE_NAME', 'per_person_type_usages_f');
568: hr_utility.raise_error;
569: End lck;
570: --
571: -- ----------------------------------------------------------------------------
572: -- |-----------------------------< convert_args >-----------------------------|
621: l_proc varchar2(72) := g_package||'convert_args';
622: --
623: Begin
624: --
625: hr_utility.set_location('Entering:'||l_proc, 5);
626: --
627: -- Convert arguments into local l_rec structure.
628: --
629: l_rec.person_type_usage_id := p_person_type_usage_id;
669: l_rec.attribute30 := p_attribute30;
670: --
671: -- Return the plsql record structure.
672: --
673: hr_utility.set_location(' Leaving:'||l_proc, 10);
674: Return(l_rec);
675: --
676: End convert_args;
677: --