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 = 'FF_ARCHIVE_ITEMS_FK1') Then
37: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
38: hr_utility.raise_error;
33: Begin
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'FF_ARCHIVE_ITEMS_FK1') Then
37: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
38: hr_utility.raise_error;
39: ElsIf (p_constraint_name = 'FF_ARCHIVE_ITEMS_PK') Then
40: /*Raise Generic Primary Key Constraint violation, supplying con. name*/
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
34: hr_utility.set_location('Entering:'||l_proc, 5);
35: --
36: If (p_constraint_name = 'FF_ARCHIVE_ITEMS_FK1') Then
37: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
38: hr_utility.raise_error;
39: ElsIf (p_constraint_name = 'FF_ARCHIVE_ITEMS_PK') Then
40: /*Raise Generic Primary Key Constraint violation, supplying con. name*/
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
37: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
38: hr_utility.raise_error;
39: ElsIf (p_constraint_name = 'FF_ARCHIVE_ITEMS_PK') Then
40: /*Raise Generic Primary Key Constraint violation, supplying con. name*/
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38: hr_utility.raise_error;
39: ElsIf (p_constraint_name = 'FF_ARCHIVE_ITEMS_PK') Then
40: /*Raise Generic Primary Key Constraint violation, supplying con. name*/
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
39: ElsIf (p_constraint_name = 'FF_ARCHIVE_ITEMS_PK') Then
40: /*Raise Generic Primary Key Constraint violation, supplying con. name*/
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
41: hr_utility.set_message(800, 'HR_7220_INVALID_PRIMARY_KEY');
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.raise_error;
49: End If;
42: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.raise_error;
49: End If;
50: --
43: hr_utility.raise_error;
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.raise_error;
49: End If;
50: --
51: hr_utility.set_location(' Leaving:'||l_proc, 10);
44: Else
45: hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
46: hr_utility.set_message_token('PROCEDURE', l_proc);
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.raise_error;
49: End If;
50: --
51: hr_utility.set_location(' Leaving:'||l_proc, 10);
52: End constraint_error;
47: hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
48: hr_utility.raise_error;
49: End If;
50: --
51: hr_utility.set_location(' Leaving:'||l_proc, 10);
52: End constraint_error;
53: --
54: -- ----------------------------------------------------------------------------
55: -- |-----------------------------< api_updating >-----------------------------|
76: l_proc varchar2(72) := g_package||'api_updating';
77: l_fct_ret boolean;
78: --
79: Begin
80: hr_utility.set_location('Entering:'||l_proc, 5);
81: --
82: If (
83: p_archive_item_id is null and
84: p_object_version_number is null
92: If (
93: p_archive_item_id = g_old_rec.archive_item_id and
94: p_object_version_number = g_old_rec.object_version_number
95: ) Then
96: hr_utility.set_location(l_proc, 10);
97: --
98: -- The g_old_rec is current therefore we must
99: -- set the returning function to true
100: --
109: Close C_Sel1;
110: --
111: -- The primary key is invalid therefore we must error
112: --
113: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
114: hr_utility.raise_error;
115: End If;
116: Close C_Sel1;
117: If (p_object_version_number <> g_old_rec.object_version_number) Then
110: --
111: -- The primary key is invalid therefore we must error
112: --
113: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
114: hr_utility.raise_error;
115: End If;
116: Close C_Sel1;
117: If (p_object_version_number <> g_old_rec.object_version_number) Then
118: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
114: hr_utility.raise_error;
115: End If;
116: Close C_Sel1;
117: If (p_object_version_number <> g_old_rec.object_version_number) Then
118: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
119: hr_utility.raise_error;
120: End If;
121: hr_utility.set_location(l_proc, 15);
122: l_fct_ret := true;
115: End If;
116: Close C_Sel1;
117: If (p_object_version_number <> g_old_rec.object_version_number) Then
118: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
119: hr_utility.raise_error;
120: End If;
121: hr_utility.set_location(l_proc, 15);
122: l_fct_ret := true;
123: End If;
117: If (p_object_version_number <> g_old_rec.object_version_number) Then
118: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
119: hr_utility.raise_error;
120: End If;
121: hr_utility.set_location(l_proc, 15);
122: l_fct_ret := true;
123: End If;
124: End If;
125: hr_utility.set_location(' Leaving:'||l_proc, 20);
121: hr_utility.set_location(l_proc, 15);
122: l_fct_ret := true;
123: End If;
124: End If;
125: hr_utility.set_location(' Leaving:'||l_proc, 20);
126: Return (l_fct_ret);
127: --
128: End api_updating;
129: --
151: --
152: l_proc varchar2(72) := g_package||'lck';
153: --
154: Begin
155: hr_utility.set_location('Entering:'||l_proc, 5);
156: --
157: -- Add any mandatory argument checking here:
158: hr_api.mandatory_arg_error
159: (p_api_name => l_proc,
166: Close C_Sel1;
167: --
168: -- The primary key is invalid therefore we must error
169: --
170: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
171: hr_utility.raise_error;
172: End If;
173: Close C_Sel1;
174: If (p_object_version_number <> g_old_rec.object_version_number) Then
167: --
168: -- The primary key is invalid therefore we must error
169: --
170: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
171: hr_utility.raise_error;
172: End If;
173: Close C_Sel1;
174: If (p_object_version_number <> g_old_rec.object_version_number) Then
175: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
171: hr_utility.raise_error;
172: End If;
173: Close C_Sel1;
174: If (p_object_version_number <> g_old_rec.object_version_number) Then
175: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
176: hr_utility.raise_error;
177: End If;
178: --
179: hr_utility.set_location(' Leaving:'||l_proc, 10);
172: End If;
173: Close C_Sel1;
174: If (p_object_version_number <> g_old_rec.object_version_number) Then
175: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
176: hr_utility.raise_error;
177: End If;
178: --
179: hr_utility.set_location(' Leaving:'||l_proc, 10);
180: --
175: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
176: hr_utility.raise_error;
177: End If;
178: --
179: hr_utility.set_location(' Leaving:'||l_proc, 10);
180: --
181: -- We need to trap the ORA LOCK exception
182: --
183: Exception
185: --
186: -- The object is locked therefore we need to supply a meaningful
187: -- error message.
188: --
189: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
190: hr_utility.set_message_token('TABLE_NAME', 'ff_archive_items');
191: hr_utility.raise_error;
192: End lck;
193: --
186: -- The object is locked therefore we need to supply a meaningful
187: -- error message.
188: --
189: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
190: hr_utility.set_message_token('TABLE_NAME', 'ff_archive_items');
191: hr_utility.raise_error;
192: End lck;
193: --
194: -- ----------------------------------------------------------------------------
187: -- error message.
188: --
189: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
190: hr_utility.set_message_token('TABLE_NAME', 'ff_archive_items');
191: hr_utility.raise_error;
192: End lck;
193: --
194: -- ----------------------------------------------------------------------------
195: -- |-----------------------------< convert_args >-----------------------------|
209: l_proc varchar2(72) := g_package||'convert_args';
210: --
211: Begin
212: --
213: hr_utility.set_location('Entering:'||l_proc, 5);
214: --
215: -- Convert arguments into local l_rec structure.
216: --
217: l_rec.archive_item_id := p_archive_item_id;
222: l_rec.object_version_number := p_object_version_number;
223: --
224: -- Return the plsql record structure.
225: --
226: hr_utility.set_location(' Leaving:'||l_proc, 10);
227: Return(l_rec);
228: --
229: End convert_args;
230: --
261: and ue.user_entity_id = db.user_entity_id;
262: --
263: Begin
264: --
265: hr_utility.set_location('Entering:'||l_proc, 5);
266: hr_utility.trace('p_value:'||p_value);
267: --
268: -- Only execute the checking code if the value has changed on
269: -- update (or insert and is not null).
262: --
263: Begin
264: --
265: hr_utility.set_location('Entering:'||l_proc, 5);
266: hr_utility.trace('p_value:'||p_value);
267: --
268: -- Only execute the checking code if the value has changed on
269: -- update (or insert and is not null).
270: --
274: or (p_value is null)) then
275: --
276: -- The value has changed or this is new, so check.
277: --
278: hr_utility.set_location(l_proc, 7);
279: --
280: -- Obtain the data type and name from the DBI
281: -- If this is not found, the creator type may be
282: -- wrong, or rows missing for this ue, so error.
287: raise proc_error;
288: END IF;
289: close csr_entity_chk;
290: --
291: hr_utility.trace('Data type'||l_data_type);
292: hr_utility.trace('Name: '||l_item_name);
293: --
294: -- Ensure that this value is of the correct data type.
295: -- raising Oracle errors where necessary. This removes the
288: END IF;
289: close csr_entity_chk;
290: --
291: hr_utility.trace('Data type'||l_data_type);
292: hr_utility.trace('Name: '||l_item_name);
293: --
294: -- Ensure that this value is of the correct data type.
295: -- raising Oracle errors where necessary. This removes the
296: -- need for complex string manipulation to ascertain
311: l_conv_date := fnd_date.canonical_to_date(p_value);
312: EXCEPTION WHEN others THEN
313: raise value_error;
314: END;
315: hr_utility.trace('Date:'||to_char(l_conv_date));
316: Elsif l_data_type = 'T' then
317: -- This data type (subj to checking) can hold any alpha-numeric
318: -- string. No checking as yet.
319: NULL;
320: End If;
321: --
322: end if;
323: --
324: hr_utility.set_location('Leaving:'||l_proc, 10);
325: --
326: exception
327: when proc_error then
328: -- The User Entity does not exist, or is not type X.
326: exception
327: when proc_error then
328: -- The User Entity does not exist, or is not type X.
329: -- raise apt error.
330: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
331: hr_utility.raise_error;
332: --
333: -- Raise Incorrect Datatype error in two circumstances.
334: --
327: when proc_error then
328: -- The User Entity does not exist, or is not type X.
329: -- raise apt error.
330: hr_utility.set_message(800, 'FF_34956_INVALID_USER_ENTITY');
331: hr_utility.raise_error;
332: --
333: -- Raise Incorrect Datatype error in two circumstances.
334: --
335: when value_error then
332: --
333: -- Raise Incorrect Datatype error in two circumstances.
334: --
335: when value_error then
336: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
337: hr_utility.set_message_token('ITEM_NAME', l_item_name);
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
333: -- Raise Incorrect Datatype error in two circumstances.
334: --
335: when value_error then
336: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
337: hr_utility.set_message_token('ITEM_NAME', l_item_name);
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
334: --
335: when value_error then
336: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
337: hr_utility.set_message_token('ITEM_NAME', l_item_name);
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
335: when value_error then
336: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
337: hr_utility.set_message_token('ITEM_NAME', l_item_name);
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
337: hr_utility.set_message_token('ITEM_NAME', l_item_name);
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
338: hr_utility.set_message_token('ITEM_VALUE', p_value);
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
339: hr_utility.raise_error;
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
340: when invalid_number then
341: hr_utility.set_message(800, 'FF_34960_INVALID_ARCHIVE_VALUE');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
348: hr_utility.set_message_token('STEP','20');
342: hr_utility.set_message_token('ITEM_NAME', l_item_name);
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
348: hr_utility.set_message_token('STEP','20');
349: hr_utility.raise_error;
350: --
343: hr_utility.set_message_token('ITEM_VALUE', p_value);
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
348: hr_utility.set_message_token('STEP','20');
349: hr_utility.raise_error;
350: --
351: end chk_value;
344: hr_utility.raise_error;
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
348: hr_utility.set_message_token('STEP','20');
349: hr_utility.raise_error;
350: --
351: end chk_value;
352:
345: when others then -- catch all for any other errors (standard).
346: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
347: hr_utility.set_message_token('PROCEDURE', l_proc);
348: hr_utility.set_message_token('STEP','20');
349: hr_utility.raise_error;
350: --
351: end chk_value;
352:
353: end ff_arc_shd;