1 package body hr_batch_lock_pkg as
2 /* $Header: pybatlck.pkb 115.0 99/07/17 05:45:21 porting ship $ */
3 --
4 /*
5 Copyright (c) Oracle Corporation 1993,1994,1995. All rights reserved
6
7 /*
8
9 Name : hr_batch_lock_pkg
10 Description : Process for locking a paylink batch.
11 Author : S.Toor
12 Date Created : 2-May-95
13 $Version$
14
15 Change List
16 -----------
17 Date Name Vers Bug No Description
18 +-----------+---------------+--------+--------+-----------------------+
19 2-May-1995 S.Toor 1.0 First Created.
20 +-----------+---------------+--------+--------+-----------------------+
21 */
22 --
23 -----------------------------------------------------------------------
24 -- NAME --
25 -- hr_batch_lock_pkg.batch_header_lock --
26 -- --
27 -- DESCRIPTION --
28 -- If an insert, update or delete is to be performed on --
29 -- either PAY_BATCH_CONTROL_TOTALS or PAY_BATCH_LINES this process --
30 -- will lock the batch in question i.e before the operation is --
31 -- performed. --
32 -- NB : If the batch_control/batch_line record is to be either --
33 -- inserted or deleted then only the batch in question is locked--
34 -- However, if the batch_control/batch_line record is to be --
35 -- updated then both the batch to be updated and the batch to --
36 -- be updated to will be locked. --
37 -----------------------------------------------------------------------
38 --
39 procedure batch_header_lock (
40 p_old_batch_id in number,
41 p_new_batch_id in number
42 ) is
43 --
44 -- DECLARATIONS
45 --
46 v_batch_id pay_batch_headers.batch_id%TYPE := null;
47 --
48 cursor c_get_header(l_old_batch_id number, l_new_batch_id number) is
49 select batch_id
50 from pay_batch_headers
51 where batch_id in (l_old_batch_id,l_new_batch_id)
52 for update;
53 --
54 begin
55 open c_get_header(p_old_batch_id,p_new_batch_id);
56 fetch c_get_header into v_batch_id;
57 close c_get_header;
58 --
59 end batch_header_lock;
60 --
61 end hr_batch_lock_pkg;