16: --
17: l_proc varchar2(72) := g_package||'constraint_error';
18: --
19: Begin
20: hr_utility.set_location('Entering:'||l_proc, 5);
21: --
22: If (p_constraint_name = 'PQH_BUDGET_PERIODS_FK1') Then
23: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
24: hr_utility.set_message_token('PROCEDURE', l_proc);
19: Begin
20: hr_utility.set_location('Entering:'||l_proc, 5);
21: --
22: If (p_constraint_name = 'PQH_BUDGET_PERIODS_FK1') Then
23: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
24: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
20: hr_utility.set_location('Entering:'||l_proc, 5);
21: --
22: If (p_constraint_name = 'PQH_BUDGET_PERIODS_FK1') Then
23: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
24: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
21: --
22: If (p_constraint_name = 'PQH_BUDGET_PERIODS_FK1') Then
23: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
24: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
22: If (p_constraint_name = 'PQH_BUDGET_PERIODS_FK1') Then
23: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
24: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
24: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
25: hr_utility.set_message_token('STEP','5');
26: hr_utility.raise_error;
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
27: ElsIf (p_constraint_name = 'PQH_BUDGET_SETS_FK2') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
28: hr_utility.set_message(8302, 'PQH_BUDGET_SETS_EXISTS');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
29: hr_utility.raise_error;
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
30: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK2') Then
31: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
32: hr_utility.set_message_token('PROCEDURE', l_proc);
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
33: hr_utility.set_message_token('STEP','10');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
34: hr_utility.raise_error;
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
35: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_FK3') Then
36: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
43: hr_utility.set_message_token('STEP','20');
37: hr_utility.set_message_token('PROCEDURE', l_proc);
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
43: hr_utility.set_message_token('STEP','20');
44: hr_utility.raise_error;
45: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_UK') Then
38: hr_utility.set_message_token('STEP','15');
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
43: hr_utility.set_message_token('STEP','20');
44: hr_utility.raise_error;
45: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_UK') Then
46: --
39: hr_utility.raise_error;
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
43: hr_utility.set_message_token('STEP','20');
44: hr_utility.raise_error;
45: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_UK') Then
46: --
47: -- Code Changed to provide a more meaningful message on
40: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_PK') Then
41: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
42: hr_utility.set_message_token('PROCEDURE', l_proc);
43: hr_utility.set_message_token('STEP','20');
44: hr_utility.raise_error;
45: ElsIf (p_constraint_name = 'PQH_BUDGET_PERIODS_UK') Then
46: --
47: -- Code Changed to provide a more meaningful message on
48: -- unique constraint failure.
46: --
47: -- Code Changed to provide a more meaningful message on
48: -- unique constraint failure.
49: --
50: hr_utility.set_message(8302,'PQH_WKS_DUPLICATE_PERIOD');
51: hr_utility.raise_error;
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
47: -- Code Changed to provide a more meaningful message on
48: -- unique constraint failure.
49: --
50: hr_utility.set_message(8302,'PQH_WKS_DUPLICATE_PERIOD');
51: hr_utility.raise_error;
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
49: --
50: hr_utility.set_message(8302,'PQH_WKS_DUPLICATE_PERIOD');
51: hr_utility.raise_error;
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
56: hr_utility.raise_error;
57: End If;
50: hr_utility.set_message(8302,'PQH_WKS_DUPLICATE_PERIOD');
51: hr_utility.raise_error;
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
56: hr_utility.raise_error;
57: End If;
58: --
51: hr_utility.raise_error;
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
56: hr_utility.raise_error;
57: End If;
58: --
59: hr_utility.set_location(' Leaving:'||l_proc, 10);
52: Else
53: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
54: hr_utility.set_message_token('PROCEDURE', l_proc);
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
56: hr_utility.raise_error;
57: End If;
58: --
59: hr_utility.set_location(' Leaving:'||l_proc, 10);
60: End constraint_error;
55: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
56: hr_utility.raise_error;
57: End If;
58: --
59: hr_utility.set_location(' Leaving:'||l_proc, 10);
60: End constraint_error;
61: --
62: -- ----------------------------------------------------------------------------
63: -- |-----------------------------< api_updating >-----------------------------|
96: l_proc varchar2(72) := g_package||'api_updating';
97: l_fct_ret boolean;
98: --
99: Begin
100: hr_utility.set_location('Entering:'||l_proc, 5);
101: --
102: If (
103: p_budget_period_id is null and
104: p_object_version_number is null
112: If (
113: p_budget_period_id = g_old_rec.budget_period_id and
114: p_object_version_number = g_old_rec.object_version_number
115: ) Then
116: hr_utility.set_location(l_proc, 10);
117: --
118: -- The g_old_rec is current therefore we must
119: -- set the returning function to true
120: --
129: Close C_Sel1;
130: --
131: -- The primary key is invalid therefore we must error
132: --
133: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
134: hr_utility.raise_error;
135: End If;
136: Close C_Sel1;
137: If (p_object_version_number <> g_old_rec.object_version_number) Then
130: --
131: -- The primary key is invalid therefore we must error
132: --
133: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
134: hr_utility.raise_error;
135: End If;
136: Close C_Sel1;
137: If (p_object_version_number <> g_old_rec.object_version_number) Then
138: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
134: hr_utility.raise_error;
135: End If;
136: Close C_Sel1;
137: If (p_object_version_number <> g_old_rec.object_version_number) Then
138: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
139: hr_utility.raise_error;
140: End If;
141: hr_utility.set_location(l_proc, 15);
142: l_fct_ret := true;
135: End If;
136: Close C_Sel1;
137: If (p_object_version_number <> g_old_rec.object_version_number) Then
138: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
139: hr_utility.raise_error;
140: End If;
141: hr_utility.set_location(l_proc, 15);
142: l_fct_ret := true;
143: End If;
137: If (p_object_version_number <> g_old_rec.object_version_number) Then
138: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
139: hr_utility.raise_error;
140: End If;
141: hr_utility.set_location(l_proc, 15);
142: l_fct_ret := true;
143: End If;
144: End If;
145: hr_utility.set_location(' Leaving:'||l_proc, 20);
141: hr_utility.set_location(l_proc, 15);
142: l_fct_ret := true;
143: End If;
144: End If;
145: hr_utility.set_location(' Leaving:'||l_proc, 20);
146: Return (l_fct_ret);
147: --
148: End api_updating;
149: --
182: --
183: l_proc varchar2(72) := g_package||'lck';
184: --
185: Begin
186: hr_utility.set_location('Entering:'||l_proc, 5);
187: --
188: -- Add any mandatory argument checking here:
189: -- Example:
190: -- hr_api.mandatory_arg_error
198: Close C_Sel1;
199: --
200: -- The primary key is invalid therefore we must error
201: --
202: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
203: hr_utility.raise_error;
204: End If;
205: Close C_Sel1;
206: If (p_object_version_number <> g_old_rec.object_version_number) Then
199: --
200: -- The primary key is invalid therefore we must error
201: --
202: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
203: hr_utility.raise_error;
204: End If;
205: Close C_Sel1;
206: If (p_object_version_number <> g_old_rec.object_version_number) Then
207: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
203: hr_utility.raise_error;
204: End If;
205: Close C_Sel1;
206: If (p_object_version_number <> g_old_rec.object_version_number) Then
207: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
208: hr_utility.raise_error;
209: End If;
210: --
211: hr_utility.set_location(' Leaving:'||l_proc, 10);
204: End If;
205: Close C_Sel1;
206: If (p_object_version_number <> g_old_rec.object_version_number) Then
207: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
208: hr_utility.raise_error;
209: End If;
210: --
211: hr_utility.set_location(' Leaving:'||l_proc, 10);
212: --
207: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
208: hr_utility.raise_error;
209: End If;
210: --
211: hr_utility.set_location(' Leaving:'||l_proc, 10);
212: --
213: -- We need to trap the ORA LOCK exception
214: --
215: Exception
217: --
218: -- The object is locked therefore we need to supply a meaningful
219: -- error message.
220: --
221: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
222: hr_utility.set_message_token('TABLE_NAME', 'pqh_budget_periods');
223: hr_utility.raise_error;
224: End lck;
225: --
218: -- The object is locked therefore we need to supply a meaningful
219: -- error message.
220: --
221: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
222: hr_utility.set_message_token('TABLE_NAME', 'pqh_budget_periods');
223: hr_utility.raise_error;
224: End lck;
225: --
226: -- ----------------------------------------------------------------------------
219: -- error message.
220: --
221: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
222: hr_utility.set_message_token('TABLE_NAME', 'pqh_budget_periods');
223: hr_utility.raise_error;
224: End lck;
225: --
226: -- ----------------------------------------------------------------------------
227: -- |-----------------------------< convert_args >-----------------------------|
252: l_proc varchar2(72) := g_package||'convert_args';
253: --
254: Begin
255: --
256: hr_utility.set_location('Entering:'||l_proc, 5);
257: --
258: -- Convert arguments into local l_rec structure.
259: --
260: l_rec.budget_period_id := p_budget_period_id;
276: l_rec.object_version_number := p_object_version_number;
277: --
278: -- Return the plsql record structure.
279: --
280: hr_utility.set_location(' Leaving:'||l_proc, 10);
281: Return(l_rec);
282: --
283: End convert_args;
284: --