55: --
56: Begin
57: if g_debug then
58: l_proc := g_package||'dt_delete_dml';
59: hr_utility.set_location('Entering:'||l_proc, 5);
60: end if;
61: If (p_datetrack_mode = 'DELETE_NEXT_CHANGE') then
62: if g_debug then
63: hr_utility.set_location(l_proc, 10);
59: hr_utility.set_location('Entering:'||l_proc, 5);
60: end if;
61: If (p_datetrack_mode = 'DELETE_NEXT_CHANGE') then
62: if g_debug then
63: hr_utility.set_location(l_proc, 10);
64: end if;
65: --
66: -- Delete the where the effective start date is equal
67: -- to the validation end date.
71: and effective_start_date = p_validation_start_date;
72: --
73: Else
74: if g_debug then
75: hr_utility.set_location(l_proc, 15);
76: end if;
77: --
78: -- Delete the row(s) where the effective start date is greater than
79: -- or equal to the validation start date.
84: --
85: End If;
86: --
87: if g_debug then
88: hr_utility.set_location(' Leaving:'||l_proc, 20);
89: end if;
90: --
91: Exception
92: When Others Then
105: --
106: l_proc varchar2(72) ;
107: --
108: Begin
109: g_debug := hr_utility.debug_enabled;
110: if g_debug then
111: l_proc := g_package||'delete_dml';
112: hr_utility.set_location('Entering:'||l_proc, 5);
113: end if;
108: Begin
109: g_debug := hr_utility.debug_enabled;
110: if g_debug then
111: l_proc := g_package||'delete_dml';
112: hr_utility.set_location('Entering:'||l_proc, 5);
113: end if;
114: --
115: dt_delete_dml(p_rec => p_rec,
116: p_effective_date => p_effective_date,
118: p_validation_start_date => p_validation_start_date,
119: p_validation_end_date => p_validation_end_date);
120: --
121: if g_debug then
122: hr_utility.set_location(' Leaving:'||l_proc, 10);
123: end if;
124: End delete_dml;
125: --
126: -- ----------------------------------------------------------------------------
167: --
168: Begin
169: if g_debug then
170: l_proc := g_package||'dt_pre_delete';
171: hr_utility.set_location('Entering:'||l_proc, 5);
172: end if;
173: --
174: If (p_datetrack_mode <> 'ZAP') then
175: --
194: p_rec.effective_start_date := null;
195: p_rec.effective_end_date := null;
196: End If;
197: if g_debug then
198: hr_utility.set_location(' Leaving:'||l_proc, 10);
199: end if;
200: End dt_pre_delete;
201: --
202: --
219:
220: begin
221: if g_debug then
222: l_proc := g_package||'pre_delete_checks';
223: hr_utility.set_location('Entering : ' || l_proc, 10);
224: end if;
225: if p_datetrack_mode = 'ZAP' then
226: if g_debug then
227: hr_utility.set_location(l_proc, 20);
223: hr_utility.set_location('Entering : ' || l_proc, 10);
224: end if;
225: if p_datetrack_mode = 'ZAP' then
226: if g_debug then
227: hr_utility.set_location(l_proc, 20);
228: end if;
229: l_exists := NULL;
230: -- if p_hr_ins = 'Y' then
231: l_exists := NULL;
239: exception when no_data_found then
240: null;
241: end;
242: if l_exists = '1' then
243: hr_utility.set_message(800,'HR_PSF_DEL_FAIL_BGT_ELE');
244: hr_utility.raise_error;
245: end if;
246: l_exists := NULL;
247: if g_debug then
240: null;
241: end;
242: if l_exists = '1' then
243: hr_utility.set_message(800,'HR_PSF_DEL_FAIL_BGT_ELE');
244: hr_utility.raise_error;
245: end if;
246: l_exists := NULL;
247: if g_debug then
248: hr_utility.set_location(l_proc, 30);
244: hr_utility.raise_error;
245: end if;
246: l_exists := NULL;
247: if g_debug then
248: hr_utility.set_location(l_proc, 30);
249: end if;
250: begin
251: select '1'
252: into l_exists
257: exception when no_data_found then
258: null;
259: end;
260: if l_exists = '1' then
261: hr_utility.set_message(800,'PER_7861_DEL_POS_REC_ACT');
262: hr_utility.raise_error;
263: end if;
264: if g_debug then
265: hr_utility.set_location(l_proc, 40);
258: null;
259: end;
260: if l_exists = '1' then
261: hr_utility.set_message(800,'PER_7861_DEL_POS_REC_ACT');
262: hr_utility.raise_error;
263: end if;
264: if g_debug then
265: hr_utility.set_location(l_proc, 40);
266: end if;
261: hr_utility.set_message(800,'PER_7861_DEL_POS_REC_ACT');
262: hr_utility.raise_error;
263: end if;
264: if g_debug then
265: hr_utility.set_location(l_proc, 40);
266: end if;
267: begin
268: select e.pos_structure_element_id
269: into l_pos_structure_element_id
280: exception when no_data_found then
281: null;
282: end;
283: if g_debug then
284: hr_utility.set_location(l_proc, 50);
285: end if;
286: l_exists := NULL;
287: if g_debug then
288: hr_utility.set_location(l_proc, 60);
284: hr_utility.set_location(l_proc, 50);
285: end if;
286: l_exists := NULL;
287: if g_debug then
288: hr_utility.set_location(l_proc, 60);
289: end if;
290: if l_pos_structure_element_id is null then
291: begin
292: select '1'
299: exception when no_data_found then
300: null;
301: end;
302: if g_debug then
303: hr_utility.set_location(l_proc, 70);
304: end if;
305: if l_exists = '1' then
306: hr_utility.set_message(800,'PER_7416_POS_IN_POS_HIER');
307: hr_utility.raise_error;
302: if g_debug then
303: hr_utility.set_location(l_proc, 70);
304: end if;
305: if l_exists = '1' then
306: hr_utility.set_message(800,'PER_7416_POS_IN_POS_HIER');
307: hr_utility.raise_error;
308: end if;
309: end if;
310: l_exists := NULL;
303: hr_utility.set_location(l_proc, 70);
304: end if;
305: if l_exists = '1' then
306: hr_utility.set_message(800,'PER_7416_POS_IN_POS_HIER');
307: hr_utility.raise_error;
308: end if;
309: end if;
310: l_exists := NULL;
311: if g_debug then
308: end if;
309: end if;
310: l_exists := NULL;
311: if g_debug then
312: hr_utility.set_location(l_proc, 80);
313: end if;
314: begin
315: select '1'
316: into l_exists
322: exception when no_data_found then
323: null;
324: end;
325: if g_debug then
326: hr_utility.set_location(l_proc, 90);
327: end if;
328: if l_exists = '1' then
329: hr_utility.set_message(801,'PER_7865_DEF_POS_DEL_GRADE');
330: hr_utility.raise_error;
325: if g_debug then
326: hr_utility.set_location(l_proc, 90);
327: end if;
328: if l_exists = '1' then
329: hr_utility.set_message(801,'PER_7865_DEF_POS_DEL_GRADE');
330: hr_utility.raise_error;
331: end if;
332: l_exists := NULL;
333: if g_debug then
326: hr_utility.set_location(l_proc, 90);
327: end if;
328: if l_exists = '1' then
329: hr_utility.set_message(801,'PER_7865_DEF_POS_DEL_GRADE');
330: hr_utility.raise_error;
331: end if;
332: l_exists := NULL;
333: if g_debug then
334: hr_utility.set_location(l_proc, 100);
330: hr_utility.raise_error;
331: end if;
332: l_exists := NULL;
333: if g_debug then
334: hr_utility.set_location(l_proc, 100);
335: end if;
336: begin
337: select '1'
338: into l_exists
343: exception when no_data_found then
344: null;
345: end;
346: if l_exists = '1' then
347: hr_utility.set_message(801,'PER_7866_DEF_POS_DEL_REQ');
348: hr_utility.raise_error;
349: end if;
350: l_exists := NULL;
351: if g_debug then
344: null;
345: end;
346: if l_exists = '1' then
347: hr_utility.set_message(801,'PER_7866_DEF_POS_DEL_REQ');
348: hr_utility.raise_error;
349: end if;
350: l_exists := NULL;
351: if g_debug then
352: hr_utility.set_location(l_proc, 110);
348: hr_utility.raise_error;
349: end if;
350: l_exists := NULL;
351: if g_debug then
352: hr_utility.set_location(l_proc, 110);
353: end if;
354: begin
355: select '1'
356: into l_exists
361: exception when no_data_found then
362: null;
363: end;
364: if l_exists = '1' then
365: hr_utility.set_message(801,'PER_7867_DEF_POS_DEL_EVAL');
366: hr_utility.raise_error;
367: end if;
368:
369: l_exists := NULL;
362: null;
363: end;
364: if l_exists = '1' then
365: hr_utility.set_message(801,'PER_7867_DEF_POS_DEL_EVAL');
366: hr_utility.raise_error;
367: end if;
368:
369: l_exists := NULL;
370: if g_debug then
367: end if;
368:
369: l_exists := NULL;
370: if g_debug then
371: hr_utility.set_location(l_proc, 120);
372: end if;
373: begin
374: select '1'
375: into l_exists
381: null;
382: end;
383:
384: if l_exists = '1' then
385: hr_utility.set_message(801,'PER_7996_POS_SUCCESSOR_REF');
386: hr_utility.raise_error;
387: end if;
388:
389: l_exists := NULL;
382: end;
383:
384: if l_exists = '1' then
385: hr_utility.set_message(801,'PER_7996_POS_SUCCESSOR_REF');
386: hr_utility.raise_error;
387: end if;
388:
389: l_exists := NULL;
390: if g_debug then
387: end if;
388:
389: l_exists := NULL;
390: if g_debug then
391: hr_utility.set_location(l_proc, 130);
392: end if;
393:
394: begin
395: select '1'
402: null;
403: end;
404:
405: if l_exists = '1' then
406: hr_utility.set_message(801,'PER_7997_POS_RELIEF_REF');
407: hr_utility.raise_error;
408: end if;
409:
410: l_exists := NULL;
403: end;
404:
405: if l_exists = '1' then
406: hr_utility.set_message(801,'PER_7997_POS_RELIEF_REF');
407: hr_utility.raise_error;
408: end if;
409:
410: l_exists := NULL;
411: if g_debug then
408: end if;
409:
410: l_exists := NULL;
411: if g_debug then
412: hr_utility.set_location(l_proc, 140);
413: end if;
414:
415: begin
416: select '1'
423: null;
424: end;
425:
426: if l_exists = '1' then
427: hr_utility.set_message(800,'HR_52776_NOT_DEL_MM_POSITIONS');
428: hr_utility.raise_error;
429: end if;
430:
431: -- end if;
424: end;
425:
426: if l_exists = '1' then
427: hr_utility.set_message(800,'HR_52776_NOT_DEL_MM_POSITIONS');
428: hr_utility.raise_error;
429: end if;
430:
431: -- end if;
432:
452: --
453: -- Open Cursor for Processing Sql statment.
454: --
455: if g_debug then
456: hr_utility.set_location(l_proc, 150);
457: end if;
458: l_sql_cursor := dbms_sql.open_cursor;
459: --
460: -- Parse SQL statement.
463: --
464: -- Map the local variables to each returned Column
465: --
466: if g_debug then
467: hr_utility.set_location(l_proc, 160);
468: end if;
469: dbms_sql.define_column(l_sql_cursor, 1,l_oci_out,1);
470: --
471: -- Execute the SQL statement.
470: --
471: -- Execute the SQL statement.
472: --
473: if g_debug then
474: hr_utility.set_location(l_proc, 170);
475: end if;
476: l_rows_fetched := dbms_sql.execute(l_sql_cursor);
477: --
478: if (dbms_sql.fetch_rows(l_sql_cursor) > 0)
476: l_rows_fetched := dbms_sql.execute(l_sql_cursor);
477: --
478: if (dbms_sql.fetch_rows(l_sql_cursor) > 0)
479: then
480: hr_utility.set_message(800,'HR_6048_PO_POS_DEL_POS_CONT');
481: hr_utility.raise_error;
482: end if;
483: --
484: -- Close cursor used for processing SQL statement.
477: --
478: if (dbms_sql.fetch_rows(l_sql_cursor) > 0)
479: then
480: hr_utility.set_message(800,'HR_6048_PO_POS_DEL_POS_CONT');
481: hr_utility.raise_error;
482: end if;
483: --
484: -- Close cursor used for processing SQL statement.
485: --
484: -- Close cursor used for processing SQL statement.
485: --
486: dbms_sql.close_cursor(l_sql_cursor);
487: if g_debug then
488: hr_utility.set_location(l_proc, 180);
489: end if;
490: end;
491: -- end if;
492: --
493: -- Ref Int check for OTA.
494: --
495: per_ota_predel_validation.ota_predel_pos_validation(p_position_id);
496: if g_debug then
497: hr_utility.set_location('Leaving : ' || l_proc, 300);
498: end if;
499: --
500: end if;
501: end pre_delete_checks;
547: where position_id = p_rec.position_id;
548: Begin
549: if g_debug then
550: l_proc := g_package||'pre_delete';
551: hr_utility.set_location('Entering:'||l_proc, 5);
552: end if;
553: -- pre delete checks
554: pre_delete_checks(p_position_id => p_rec.position_id
555: ,p_business_group_id => p_rec.business_group_id
586: p_validation_start_date => p_validation_start_date,
587: p_validation_end_date => p_validation_end_date);
588: --
589: if g_debug then
590: hr_utility.set_location(' Leaving:'||l_proc, 10);
591: end if;
592: End pre_delete;
593: --
594: -- ----------------------------------------------------------------------------
635: Begin
636: if g_debug then
637: l_proc := g_package||'post_delete';
638: --
639: hr_utility.set_location('Entering:'||l_proc, 5);
640: end if;
641: --
642: -- User Hook
643: --
786: --
787: hr_psf_shd.position_wf_sync(p_rec.position_id , p_validation_start_date);
788: --
789: if g_debug then
790: hr_utility.set_location(' Leaving:'||l_proc, 10);
791: end if;
792: End post_delete;
793: --
794: -- ----------------------------------------------------------------------------
811: from hr_all_positions_f
812: where position_id = p_rec.position_id;
813: --
814: Begin
815: g_debug := hr_utility.debug_enabled;
816: if g_debug then
817: l_proc := g_package||'del';
818: hr_utility.set_location('Entering:'||l_proc, 5);
819: end if;
814: Begin
815: g_debug := hr_utility.debug_enabled;
816: if g_debug then
817: l_proc := g_package||'del';
818: hr_utility.set_location('Entering:'||l_proc, 5);
819: end if;
820: --
821: -- Ensure that the DateTrack delete mode is valid
822: --
892: Raise HR_Api.Validate_Enabled;
893: End If;
894: --
895: if g_debug then
896: hr_utility.set_location(' Leaving:'||l_proc, 10);
897: end if;
898:
899: Exception
900: When HR_Api.Validate_Enabled Then
923: l_rec hr_psf_shd.g_rec_type;
924: l_proc varchar2(72);
925: --
926: Begin
927: g_debug := hr_utility.debug_enabled;
928: if g_debug then
929: l_proc := g_package||'del';
930: hr_utility.set_location('Entering:'||l_proc, 5);
931: end if;
926: Begin
927: g_debug := hr_utility.debug_enabled;
928: if g_debug then
929: l_proc := g_package||'del';
930: hr_utility.set_location('Entering:'||l_proc, 5);
931: end if;
932: --
933: -- As the delete procedure accepts a plsql record structure we do need to
934: -- convert the arguments into the record structure.
952: p_effective_start_date := l_rec.effective_start_date;
953: p_effective_end_date := l_rec.effective_end_date;
954: --
955: if g_debug then
956: hr_utility.set_location(' Leaving:'||l_proc, 10);
957: end if;
958: End del;
959:
960: end hr_psf_del;