DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_LOCKER_TYPES_UPLOAD_PKG

Source


1 PACKAGE BODY hxc_locker_types_upload_pkg AS
2 /* $Header: hxclocktypesload.pkb 115.1 2004/05/13 02:18:43 dragarwa noship $ */
3 
4 PROCEDURE load_locker_types_row (
5 	  p_process_type	     IN VARCHAR2
6         , p_locker_type		     IN VARCHAR2
7 	, p_owner                    IN VARCHAR2
8 	, p_custom_mode	     	     IN VARCHAR2 ) IS
9 
10 l_locker_type_id  		hxc_locker_types.locker_type_id%TYPE;
11 l_locker_type  			hxc_locker_types.locker_type%TYPE;
12 l_process_type  		hxc_locker_types.process_type%TYPE;
13 l_owner				VARCHAR2(4000);
14 
15 BEGIN
16 
17 BEGIN
18 	SELECT           locker_type_id
19 			, fnd_load_util.owner_name(NVL(last_updated_by,-1))
20 			, locker_type
21 			, process_type
22 
23 	INTO	         l_locker_type_id
24 			,l_owner
25 			,l_locker_type
26 			,l_process_type
27 
28 	FROM 		 hxc_locker_types lot
29 	WHERE   lot.process_type = p_process_type
30 	AND     lot.locker_type = p_locker_type;
31 
32 
33 	IF ( p_custom_mode = 'FORCE' OR l_owner = 'ORACLE' )
34 	THEN
35 		-- only update if the alias component mapping that has actually changed
36 
37 
38 		hxc_lck_upd.upd
39 		  (
40 		     p_locker_type_id		=>l_locker_type_id
41 		    ,p_locker_type              =>l_locker_type
42 		    ,p_process_type             => l_process_type
43 		  );
44 
45 	END IF;
46 EXCEPTION WHEN NO_DATA_FOUND
47 THEN
48 		hxc_lck_ins.ins
49 		  (  p_locker_type              =>p_locker_type
50 		    ,p_process_type             => p_process_type
51 		    ,p_locker_type_id		=>l_locker_type_id
52 		  );
53 END;
54 
55 END load_locker_types_row;
56 PROCEDURE load_locker_types_row (
57 	  p_process_type	     IN VARCHAR2
58         , p_locker_type		     IN VARCHAR2
59 	, p_owner                    IN VARCHAR2
60 	, p_custom_mode	     	    IN VARCHAR2
61 	,p_last_update_date         IN VARCHAR2 ) IS
62 l_locker_type_id  		hxc_locker_types.locker_type_id%TYPE;
63 l_locker_type  			hxc_locker_types.locker_type%TYPE;
64 l_process_type  		hxc_locker_types.process_type%TYPE;
65 
66 l_last_update_date_db              hxc_locker_types.last_update_date%TYPE;
67 l_last_updated_by_db               hxc_locker_types.last_updated_by%TYPE;
68 l_last_updated_by_f               hxc_locker_types.last_updated_by%TYPE;
69 l_last_update_date_f               hxc_locker_types.last_update_date%TYPE;
70 BEGIN
71 
72 BEGIN
73 l_last_updated_by_f := fnd_load_util.owner_id(p_owner);
74 l_last_update_date_f := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'), sysdate);
75 	SELECT           locker_type_id
76 
77 			, locker_type
78 			, process_type
79 			,last_update_date
80 			,last_updated_by
81 
82 	INTO	         l_locker_type_id
83 
84 			,l_locker_type
85 			,l_process_type
86 			,l_last_update_date_db
87                         ,l_last_updated_by_db
88 
89 	FROM 		 hxc_locker_types lot
90 	WHERE   lot.process_type = p_process_type
91 	AND     lot.locker_type = p_locker_type;
92 
93 
94 	IF (fnd_load_util.upload_test(	l_last_updated_by_f,
95 					l_last_update_date_f,
96 	                        	 l_last_updated_by_db,
97 					l_last_update_date_db ,
98 					 p_custom_mode))
99 	THEN
100 		-- only update if the alias component mapping that has actually changed
101 
102 		hxc_lck_upd.upd
103 		  (
104 		     p_locker_type_id		=>l_locker_type_id
105 		    ,p_locker_type              =>l_locker_type
106 		    ,p_process_type             => l_process_type
107 		  );
108 
109 	END IF;
110 EXCEPTION WHEN NO_DATA_FOUND
111 THEN
112 		hxc_lck_ins.ins
113 		  (  p_locker_type              =>p_locker_type
114 		    ,p_process_type             => p_process_type
115 		    ,p_locker_type_id		=>l_locker_type_id
116 		  );
117 END;
118 
119 END load_locker_types_row;
120 
121 END hxc_locker_types_upload_pkg;