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 = 'PER_ESTABLISHMENTS_PK') Then
37: hr_utility.set_message(800,'HR_51492_ESA_ESTAB_ID_PK ');
38: hr_utility.raise_error;
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'PER_ESTABLISHMENTS_PK') Then
37: hr_utility.set_message(800,'HR_51492_ESA_ESTAB_ID_PK ');
38: hr_utility.raise_error;
39: Elsif (p_constraint_name = 'PER_ESTABLISHMENTS_UK') Then
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'PER_ESTABLISHMENTS_PK') Then
37: hr_utility.set_message(800,'HR_51492_ESA_ESTAB_ID_PK ');
38: hr_utility.raise_error;
39: Elsif (p_constraint_name = 'PER_ESTABLISHMENTS_UK') Then
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
42: Else
36: If (p_constraint_name = 'PER_ESTABLISHMENTS_PK') Then
37: hr_utility.set_message(800,'HR_51492_ESA_ESTAB_ID_PK ');
38: hr_utility.raise_error;
39: Elsif (p_constraint_name = 'PER_ESTABLISHMENTS_UK') Then
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
37: hr_utility.set_message(800,'HR_51492_ESA_ESTAB_ID_PK ');
38: hr_utility.raise_error;
39: Elsif (p_constraint_name = 'PER_ESTABLISHMENTS_UK') Then
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
39: Elsif (p_constraint_name = 'PER_ESTABLISHMENTS_UK') Then
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
46: hr_utility.raise_error;
47: End If;
40: hr_utility.set_message(801, 'HR_51485_EST_NAME_LOCAT_UNIQUE');
41: hr_utility.raise_error;
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
46: hr_utility.raise_error;
47: End If;
48: --
41: hr_utility.raise_error;
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
46: hr_utility.raise_error;
47: End If;
48: --
49: hr_utility.set_location(' Leaving:'||l_proc, 10);
42: Else
43: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
44: hr_utility.set_message_token('PROCEDURE', l_proc);
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
46: hr_utility.raise_error;
47: End If;
48: --
49: hr_utility.set_location(' Leaving:'||l_proc, 10);
50: End constraint_error;
45: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
46: hr_utility.raise_error;
47: End If;
48: --
49: hr_utility.set_location(' Leaving:'||l_proc, 10);
50: End constraint_error;
51: --
52: -- ----------------------------------------------------------------------------
53: -- |-----------------------------< api_updating >-----------------------------|
115: l_proc varchar2(72) := g_package||'api_updating';
116: l_fct_ret boolean;
117: --
118: Begin
119: hr_utility.set_location('Entering:'||l_proc, 5);
120: --
121: If (
122: p_establishment_id is null and
123: p_object_version_number is null
131: If (
132: p_establishment_id = g_old_rec.establishment_id and
133: p_object_version_number = g_old_rec.object_version_number
134: ) Then
135: hr_utility.set_location(l_proc, 10);
136: --
137: -- The g_old_rec is current therefore we must
138: -- set the returning function to true
139: --
148: Close C_Sel1;
149: --
150: -- The primary key is invalid therefore we must error
151: --
152: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
153: hr_utility.raise_error;
154: End If;
155: Close C_Sel1;
156: If (p_object_version_number <> g_old_rec.object_version_number) Then
149: --
150: -- The primary key is invalid therefore we must error
151: --
152: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
153: hr_utility.raise_error;
154: End If;
155: Close C_Sel1;
156: If (p_object_version_number <> g_old_rec.object_version_number) Then
157: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
153: hr_utility.raise_error;
154: End If;
155: Close C_Sel1;
156: If (p_object_version_number <> g_old_rec.object_version_number) Then
157: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
158: hr_utility.raise_error;
159: End If;
160: hr_utility.set_location(l_proc, 15);
161: l_fct_ret := true;
154: End If;
155: Close C_Sel1;
156: If (p_object_version_number <> g_old_rec.object_version_number) Then
157: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
158: hr_utility.raise_error;
159: End If;
160: hr_utility.set_location(l_proc, 15);
161: l_fct_ret := true;
162: End If;
156: If (p_object_version_number <> g_old_rec.object_version_number) Then
157: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
158: hr_utility.raise_error;
159: End If;
160: hr_utility.set_location(l_proc, 15);
161: l_fct_ret := true;
162: End If;
163: End If;
164: hr_utility.set_location(' Leaving:'||l_proc, 20);
160: hr_utility.set_location(l_proc, 15);
161: l_fct_ret := true;
162: End If;
163: End If;
164: hr_utility.set_location(' Leaving:'||l_proc, 20);
165: Return (l_fct_ret);
166: --
167: End api_updating;
168: --
230: --
231: l_proc varchar2(72) := g_package||'lck';
232: --
233: Begin
234: hr_utility.set_location('Entering:'||l_proc, 5);
235: --
236: -- Add any mandatory argument checking here:
237: -- Example:
238: -- hr_api.mandatory_arg_error
246: Close C_Sel1;
247: --
248: -- The primary key is invalid therefore we must error
249: --
250: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
251: hr_utility.raise_error;
252: End If;
253: Close C_Sel1;
254: If (p_object_version_number <> g_old_rec.object_version_number) Then
247: --
248: -- The primary key is invalid therefore we must error
249: --
250: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
251: hr_utility.raise_error;
252: End If;
253: Close C_Sel1;
254: If (p_object_version_number <> g_old_rec.object_version_number) Then
255: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
251: hr_utility.raise_error;
252: End If;
253: Close C_Sel1;
254: If (p_object_version_number <> g_old_rec.object_version_number) Then
255: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
256: hr_utility.raise_error;
257: End If;
258: --
259: hr_utility.set_location(' Leaving:'||l_proc, 10);
252: End If;
253: Close C_Sel1;
254: If (p_object_version_number <> g_old_rec.object_version_number) Then
255: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
256: hr_utility.raise_error;
257: End If;
258: --
259: hr_utility.set_location(' Leaving:'||l_proc, 10);
260: --
255: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
256: hr_utility.raise_error;
257: End If;
258: --
259: hr_utility.set_location(' Leaving:'||l_proc, 10);
260: --
261: -- We need to trap the ORA LOCK exception
262: --
263: Exception
265: --
266: -- The object is locked therefore we need to supply a meaningful
267: -- error message.
268: --
269: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
270: hr_utility.set_message_token('TABLE_NAME', 'per_establishments');
271: hr_utility.raise_error;
272: End lck;
273: --
266: -- The object is locked therefore we need to supply a meaningful
267: -- error message.
268: --
269: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
270: hr_utility.set_message_token('TABLE_NAME', 'per_establishments');
271: hr_utility.raise_error;
272: End lck;
273: --
274: -- ----------------------------------------------------------------------------
267: -- error message.
268: --
269: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
270: hr_utility.set_message_token('TABLE_NAME', 'per_establishments');
271: hr_utility.raise_error;
272: End lck;
273: --
274: -- ----------------------------------------------------------------------------
275: -- |-----------------------------< convert_args >-----------------------------|
329: l_proc varchar2(72) := g_package||'convert_args';
330: --
331: Begin
332: --
333: hr_utility.set_location('Entering:'||l_proc, 5);
334: --
335: -- Convert arguments into local l_rec structure.
336: --
337: l_rec.establishment_id := p_establishment_id;
382: l_rec.object_version_number := p_object_version_number;
383: --
384: -- Return the plsql record structure.
385: --
386: hr_utility.set_location(' Leaving:'||l_proc, 10);
387: Return(l_rec);
388: --
389: End convert_args;
390: --