DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_FTR_SHD

Source


1 Package Body pqh_ftr_shd as
2 /* $Header: pqftrrhi.pkb 115.4 2002/11/27 23:43:38 rpasapul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_ftr_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14   (p_constraint_name in all_constraints.constraint_name%TYPE
15   ) Is
16 --
17   l_proc        varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20   --
21   /* If (p_constraint_name = 'PQH_DE_WRKPLC_VLDTN_JOBFTRS_FK') Then
22     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23     fnd_message.set_token('PROCEDURE', l_proc);
24     fnd_message.set_token('STEP','5');
25     fnd_message.raise_error; */
26    If (p_constraint_name = 'PQH_DE_WRKPLC_VLDTN_JOBFTRS_PK') Then
27     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('STEP','10');
30     fnd_message.raise_error;
31   /*ElsIf (p_constraint_name = 'PQH_DE_WRKPLC_VLDTN_JOBFTR_FK1') Then
32     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
33     fnd_message.set_token('PROCEDURE', l_proc);
34     fnd_message.set_token('STEP','15');
35     fnd_message.raise_error; */
36   Else
37     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
38     fnd_message.set_token('PROCEDURE', l_proc);
39     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
40     fnd_message.raise_error;
41   End If;
42   --
43 End constraint_error;
44 --
45 -- ----------------------------------------------------------------------------
46 -- |-----------------------------< api_updating >-----------------------------|
47 -- ----------------------------------------------------------------------------
48 Function api_updating
49   (p_wrkplc_vldtn_jobftr_id               in     number
50   ,p_object_version_number                in     number
51   )
52   Return Boolean Is
53   --
54   --
55   -- Cursor selects the 'current' row from the HR Schema
56   --
57   Cursor C_Sel1 is
58     select
59        wrkplc_vldtn_jobftr_id
60       ,wrkplc_vldtn_opr_job_id
61       ,job_feature_code
62       ,wrkplc_vldtn_opr_job_type
63       ,business_group_id
64       ,object_version_number
65     from        pqh_de_wrkplc_vldtn_jobftrs
66     where       wrkplc_vldtn_jobftr_id = p_wrkplc_vldtn_jobftr_id;
67   --
68   l_fct_ret     boolean;
69   --
70 Begin
71   --
72   If (p_wrkplc_vldtn_jobftr_id is null and
73       p_object_version_number is null
74      ) Then
75     --
76     -- One of the primary key arguments is null therefore we must
77     -- set the returning function value to false
78     --
79     l_fct_ret := false;
80   Else
81     If (p_wrkplc_vldtn_jobftr_id
82         = pqh_ftr_shd.g_old_rec.wrkplc_vldtn_jobftr_id and
83         p_object_version_number
84         = pqh_ftr_shd.g_old_rec.object_version_number
85        ) Then
86       --
87       -- The g_old_rec is current therefore we must
88       -- set the returning function to true
89       --
90       l_fct_ret := true;
91     Else
92       --
93       -- Select the current row into g_old_rec
94       --
95       Open C_Sel1;
96       Fetch C_Sel1 Into pqh_ftr_shd.g_old_rec;
97       If C_Sel1%notfound Then
98         Close C_Sel1;
99         --
100         -- The primary key is invalid therefore we must error
101         --
102         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
103         fnd_message.raise_error;
104       End If;
105       Close C_Sel1;
106       If (p_object_version_number
107           <> pqh_ftr_shd.g_old_rec.object_version_number) Then
108         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
109         fnd_message.raise_error;
110       End If;
111       l_fct_ret := true;
112     End If;
113   End If;
114   Return (l_fct_ret);
115 --
116 End api_updating;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------------< lck >----------------------------------|
120 -- ----------------------------------------------------------------------------
121 Procedure lck
122   (p_wrkplc_vldtn_jobftr_id               in     number
123   ,p_object_version_number                in     number
124   ) is
125 --
126 -- Cursor selects the 'current' row from the HR Schema
127 --
128   Cursor C_Sel1 is
129     select
130        wrkplc_vldtn_jobftr_id
131       ,wrkplc_vldtn_opr_job_id
132       ,job_feature_code
133       ,wrkplc_vldtn_opr_job_type
134       ,business_group_id
135       ,object_version_number
136     from        pqh_de_wrkplc_vldtn_jobftrs
137     where       wrkplc_vldtn_jobftr_id = p_wrkplc_vldtn_jobftr_id
138     for update nowait;
139 --
140   l_proc        varchar2(72) := g_package||'lck';
141 --
142 Begin
143   hr_utility.set_location('Entering:'||l_proc, 5);
144   --
145   hr_api.mandatory_arg_error
146     (p_api_name           => l_proc
147     ,p_argument           => 'WRKPLC_VLDTN_JOBFTR_ID'
148     ,p_argument_value     => p_wrkplc_vldtn_jobftr_id
149     );
150   hr_utility.set_location(l_proc,6);
151   hr_api.mandatory_arg_error
152     (p_api_name           => l_proc
153     ,p_argument           => 'OBJECT_VERSION_NUMBER'
154     ,p_argument_value     => p_object_version_number
155     );
156   --
157   Open  C_Sel1;
158   Fetch C_Sel1 Into pqh_ftr_shd.g_old_rec;
159   If C_Sel1%notfound then
160     Close C_Sel1;
161     --
162     -- The primary key is invalid therefore we must error
163     --
164     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
165     fnd_message.raise_error;
166   End If;
167   Close C_Sel1;
168   If (p_object_version_number
169       <> pqh_ftr_shd.g_old_rec.object_version_number) Then
170         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
171         fnd_message.raise_error;
172   End If;
173   --
174   hr_utility.set_location(' Leaving:'||l_proc, 10);
175   --
176   -- We need to trap the ORA LOCK exception
177   --
178 Exception
179   When HR_Api.Object_Locked then
180     --
181     -- The object is locked therefore we need to supply a meaningful
182     -- error message.
183     --
184     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
185     fnd_message.set_token('TABLE_NAME', 'pqh_de_wrkplc_vldtn_jobftrs');
186     fnd_message.raise_error;
187 End lck;
188 --
189 -- ----------------------------------------------------------------------------
190 -- |-----------------------------< convert_args >-----------------------------|
191 -- ----------------------------------------------------------------------------
192 Function convert_args
193   (p_wrkplc_vldtn_jobftr_id         in number
194   ,p_wrkplc_vldtn_opr_job_id        in number
195   ,p_job_feature_code               in varchar2
196   ,p_wrkplc_vldtn_opr_job_type      in varchar2
197   ,p_business_group_id              in number
198   ,p_object_version_number          in number
199   )
200   Return g_rec_type is
201 --
202   l_rec   g_rec_type;
203 --
204 Begin
205   --
206   -- Convert arguments into local l_rec structure.
207   --
208   l_rec.wrkplc_vldtn_jobftr_id           := p_wrkplc_vldtn_jobftr_id;
209   l_rec.wrkplc_vldtn_opr_job_id          := p_wrkplc_vldtn_opr_job_id;
210   l_rec.job_feature_code                 := p_job_feature_code;
211   l_rec.wrkplc_vldtn_opr_job_type        := p_wrkplc_vldtn_opr_job_type;
212   l_rec.business_group_id                := p_business_group_id;
213   l_rec.object_version_number            := p_object_version_number;
214   --
215   -- Return the plsql record structure.
216   --
217   Return(l_rec);
218 --
219 End convert_args;
220 --
221 end pqh_ftr_shd;