DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_RESTYPE_MAPPING_PKG

Source


1 PACKAGE BODY PA_RESTYPE_MAPPING_PKG AS
2 /* $Header: PARSUPGB.pls 120.0 2005/05/31 15:55:52 appldev noship $ */
3 
4 --Procedure : Insert_row
5 --Purpose   : Purpose of this procedure is to insert data into pa_restype_map_to_resformat table.
6 --Parameters: All Parameters passed to his procedure are IN parameters.
7 
8 PROCEDURE INSERT_ROW(
9  PX_ROWID               IN OUT NOCOPY ROWID,
10  P_GROUP_RES_TYPE_CODE IN pa_restype_map_to_resformat.group_res_type_code%type,
11  P_RES_TYPE_CODE      IN pa_restype_map_to_resformat.res_type_code%type,
12  P_RES_FORMAT_ID     IN pa_restype_map_to_resformat.res_format_id%type,
13  P_RESOURCE_CLASS_ID IN pa_restype_map_to_resformat.resource_class_id%type,
14  P_LABOR_FLAG       IN pa_restype_map_to_resformat.labor_flag%type,
15  P_CREATION_DATE IN pa_restype_map_to_resformat.creation_date%type,
16  P_CREATED_BY   IN pa_restype_map_to_resformat.created_by%type,
17  P_LAST_UPDATE_LOGIN IN pa_restype_map_to_resformat.last_update_login%type,
18  P_LAST_UPDATED_BY  IN pa_restype_map_to_resformat.last_updated_by%type,
19  P_LAST_UPDATE_DATE IN pa_restype_map_to_resformat.last_update_date%type
20 ) IS
21 
22 
23 
24 BEGIN
25 
26 
27   INSERT INTO PA_RESTYPE_MAP_TO_RESFORMAT(
28  GROUP_RES_TYPE_CODE,
29  RES_TYPE_CODE      ,
30  RES_FORMAT_ID     ,
31  RESOURCE_CLASS_ID,
32  LABOR_FLAG      ,
33  CREATION_DATE ,
34  CREATED_BY   ,
35  LAST_UPDATE_LOGIN,
36  LAST_UPDATED_BY ,
37  LAST_UPDATE_DATE
38   ) VALUES (
39  P_GROUP_RES_TYPE_CODE,
40  P_RES_TYPE_CODE     ,
41  P_RES_FORMAT_ID    ,
42  P_RESOURCE_CLASS_ID,
43  P_LABOR_FLAG      ,
44  P_CREATION_DATE ,
45  P_CREATED_BY  ,
46  P_LAST_UPDATE_LOGIN,
47  P_LAST_UPDATED_BY ,
48  P_LAST_UPDATE_DATE
49   );
50 END INSERT_ROW;
51 
52 --Procedure : Update_row
53 --Purpose   : Purpose of this procedure is to update data of pa_restype_map_to_resformat table.
54 --Parameters: All Parameters passed to his procedure are IN parameters.
55 
56 PROCEDURE UPDATE_ROW(
57  P_GROUP_RES_TYPE_CODE IN pa_restype_map_to_resformat.group_res_type_code%type,
58  P_RES_TYPE_CODE      IN pa_restype_map_to_resformat.res_type_code%type,
59  P_RES_FORMAT_ID     IN pa_restype_map_to_resformat.res_format_id%type,
60  P_RESOURCE_CLASS_ID IN pa_restype_map_to_resformat.resource_class_id%type,
61  P_LABOR_FLAG       IN pa_restype_map_to_resformat.labor_flag%type,
62  P_CREATION_DATE IN pa_restype_map_to_resformat.creation_date%type,
63  P_CREATED_BY   IN pa_restype_map_to_resformat.created_by%type,
64  P_LAST_UPDATE_LOGIN IN pa_restype_map_to_resformat.last_update_login%type,
65  P_LAST_UPDATED_BY  IN pa_restype_map_to_resformat.last_updated_by%type,
66  P_LAST_UPDATE_DATE IN pa_restype_map_to_resformat.last_update_date%type
67 ) IS
68 BEGIN
69 
70   UPDATE pa_restype_map_to_resformat
71  set GROUP_RES_TYPE_CODE= P_GROUP_RES_TYPE_CODE,
72  RES_TYPE_CODE =     P_RES_TYPE_CODE,
73  RES_FORMAT_ID  =   P_RES_FORMAT_ID,
74  RESOURCE_CLASS_ID= P_RESOURCE_CLASS_ID,
75  LABOR_FLAG     = P_LABOR_FLAG,
76  CREATION_DATE = P_CREATION_DATE,
77  CREATED_BY   = P_CREATED_BY,
78  LAST_UPDATE_LOGIN= P_LAST_UPDATE_LOGIN,
79  LAST_UPDATED_BY = P_LAST_UPDATED_BY,
80  LAST_UPDATE_DATE= P_LAST_UPDATE_DATE
81  where group_res_type_code = p_group_res_type_code and
82        res_type_code = p_res_type_code and
83        res_format_id = p_res_format_id
84        and labor_flag = p_labor_flag;
85 
86   IF (SQL%NOTFOUND) THEN
87     RAISE no_data_found;
88   END IF;
89 
90 END UPDATE_ROW;
91 
92 --Procedure : Delete_row
93 --Purpose   : Purpose of this procedure is to delet data from pa_restype_map_to_resformat table.
94 --Parameters: All Parameters passed to this procedure are IN parameters.
95 
96 PROCEDURE DELETE_ROW(
97  P_GROUP_RES_TYPE_CODE IN pa_restype_map_to_resformat.group_res_type_code%type,
98  P_RES_TYPE_CODE      IN pa_restype_map_to_resformat.res_type_code%type,
99  P_RES_FORMAT_ID     IN pa_restype_map_to_resformat.res_format_id%type)
100 IS
101 
102 begin
103  delete from pa_restype_map_to_resformat
104  where GROUP_RES_TYPE_CODE = P_GROUP_RES_TYPE_CODE
105  and   RES_TYPE_CODE =  P_RES_TYPE_CODE
106  and   RES_FORMAT_ID = P_RES_FORMAT_ID;
107 
108  if (SQL%NOTFOUND) then
109    raise no_data_found;
110  end if;
111 
112 end delete_row;
113 
114 --Procedure : Lock_row
115 --Purpose   : Purpose of this procedure is to lock data from pa_restype_map_to_resformat table.
116 --Parameters: All Parameters passed to this procedure are IN parameters.
117 
118 PROCEDURE LOCK_ROW(
119  P_GROUP_RES_TYPE_CODE IN pa_restype_map_to_resformat.group_res_type_code%type,
120  P_RES_TYPE_CODE      IN pa_restype_map_to_resformat.res_type_code%type,
121  P_RES_FORMAT_ID     IN pa_restype_map_to_resformat.res_format_id%type)
122 IS
123 
124    cursor lock_row_csr is
125    select GROUP_RES_TYPE_CODE,RES_TYPE_CODE,RES_FORMAT_ID
126    from  pa_restype_map_to_resformat
127    for update of GROUP_RES_TYPE_CODE,RES_TYPE_CODE,RES_FORMAT_ID NOWAIT;
128 
129    recinfo lock_row_csr%rowtype;
130 begin
131 
132    open lock_row_csr;
133    fetch lock_row_csr into recinfo;
134    close lock_row_csr;
135 
136    return;
137 END LOCK_ROW;
138 
139 --Procedure : Load_row
140 --Purpose   : Purpose of this procedure is to load data into pa_restype_map_to_resformat table.
141 --Parameters: All Parameters passed to this procedure are IN parameters.
142 PROCEDURE LOAD_ROW(
143  P_GROUP_RES_TYPE_CODE IN pa_restype_map_to_resformat.group_res_type_code%type,
144  P_RES_TYPE_CODE      IN pa_restype_map_to_resformat.res_type_code%type,
145  P_RES_FORMAT_ID     IN pa_restype_map_to_resformat.res_format_id%type,
146  P_RESOURCE_CLASS_ID IN pa_restype_map_to_resformat.resource_class_id%type,
147  P_LABOR_FLAG       IN pa_restype_map_to_resformat.labor_flag%type,
148  P_CREATION_DATE IN pa_restype_map_to_resformat.creation_date%type,
149  P_CREATED_BY   IN pa_restype_map_to_resformat.created_by%type,
150  P_LAST_UPDATE_LOGIN IN pa_restype_map_to_resformat.last_update_login%type,
151  P_LAST_UPDATED_BY  IN pa_restype_map_to_resformat.last_updated_by%type,
152  P_LAST_UPDATE_DATE IN pa_restype_map_to_resformat.last_update_date%type,
153  P_OWNER            IN VARCHAR2
154 ) IS
155 
156  PX_ROWID ROWID;
157 
158 BEGIN
159 
160  PA_RESTYPE_MAPPING_PKG.UPDATE_ROW(
161  P_GROUP_RES_TYPE_CODE => P_GROUP_RES_TYPE_CODE,
162  P_RES_TYPE_CODE       => P_RES_TYPE_CODE,
163  P_RES_FORMAT_ID      =>  P_RES_FORMAT_ID,
164  P_RESOURCE_CLASS_ID => P_RESOURCE_CLASS_ID,
165  P_LABOR_FLAG       => P_LABOR_FLAG,
166  P_CREATION_DATE  => P_CREATION_DATE,
167  P_CREATED_BY    => P_CREATED_BY,
168  P_LAST_UPDATE_LOGIN => P_LAST_UPDATE_LOGIN,
169  P_LAST_UPDATED_BY  => P_LAST_UPDATED_BY,
170  P_LAST_UPDATE_DATE => P_LAST_UPDATE_DATE);
171 
172 
173   EXCEPTION
174      WHEN no_data_found then
175  PA_RESTYPE_MAPPING_PKG.INSERT_ROW(
176  PX_ROWID               => PX_ROWID,
177  P_GROUP_RES_TYPE_CODE => P_GROUP_RES_TYPE_CODE,
178  P_RES_TYPE_CODE       => P_RES_TYPE_CODE,
179  P_RES_FORMAT_ID      =>  P_RES_FORMAT_ID,
180  P_RESOURCE_CLASS_ID => P_RESOURCE_CLASS_ID,
181  P_LABOR_FLAG       => P_LABOR_FLAG,
182  P_CREATION_DATE  => P_CREATION_DATE,
183  P_CREATED_BY    => P_CREATED_BY,
184  P_LAST_UPDATE_LOGIN => P_LAST_UPDATE_LOGIN,
185  P_LAST_UPDATED_BY  => P_LAST_UPDATED_BY,
186  P_LAST_UPDATE_DATE => P_LAST_UPDATE_DATE);
187 
188 END LOAD_ROW;
189 
190 
191 END PA_RESTYPE_MAPPING_PKG;