[Home] [Help]
PACKAGE BODY: APPS.PQH_CEC_BUS
Source
1 Package Body pqh_cec_bus as
2 /* $Header: pqcecrhi.pkb 120.3 2011/04/28 09:42:08 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_cec_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_context >------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 -- This procedure is used to check that the primary key for the table
16 -- is created properly. It should be null on insert and
17 -- should not be able to be updated.
18 --
19 -- Pre Conditions
20 -- None.
21 --
22 -- In Parameters
23 -- context PK of record being inserted or updated.
24 -- object_version_number Object version number of record being
25 -- inserted or updated.
26 --
27 -- Post Success
28 -- Processing continues
29 --
30 -- Post Failure
31 -- Errors handled by the procedure
32 --
33 -- Access Status
34 -- Internal table handler use only.
35 --
36 Procedure chk_context(p_context in varchar2,
37 p_object_version_number in number) is
38 --
39 l_proc varchar2(72) := g_package||'chk_context';
40 l_api_updating boolean;
41 --
42 Begin
43 --
44 hr_utility.set_location('Entering:'||l_proc, 5);
45 --
46 l_api_updating := pqh_cec_shd.api_updating
47 (p_context => p_context,
48 p_object_version_number => p_object_version_number);
49 --
50 if (l_api_updating
51 and nvl(p_context,hr_api.g_varchar2)
52 <> pqh_cec_shd.g_old_rec.context) then
53 --
54 -- raise error as PK has changed
55 --
56 pqh_cec_shd.constraint_error('PQH_COPY_ENTITY_CONTEXTS_PK');
57 --
58 -- elsif not l_api_updating then
59 --
60 -- check if PK is null
61 -- this is not true here as context is not generated
62 --
63 -- if p_context is not null then
64 --
65 -- raise error as PK is not null
66 --
67 -- pqh_cec_shd.constraint_error('PQH_COPY_ENTITY_CONTEXTS_PK');
68 --
69 -- end if;
70 --
71 end if;
72 --
73 hr_utility.set_location('Leaving:'||l_proc, 10);
74 --
75 End chk_context;
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< insert_validate >----------------------------|
79 -- ----------------------------------------------------------------------------
80 Procedure insert_validate(p_rec in pqh_cec_shd.g_rec_type) is
81 --
82 l_proc varchar2(72) := g_package||'insert_validate';
83 --
84 Begin
85 hr_utility.set_location('Entering:'||l_proc, 5);
86 --
87 -- Call all supporting business operations
88 --
89 chk_context
90 (p_context => p_rec.context,
91 p_object_version_number => p_rec.object_version_number);
92 --
93 --
94 --
95 hr_utility.set_location(' Leaving:'||l_proc, 10);
96 End insert_validate;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |---------------------------< update_validate >----------------------------|
100 -- ----------------------------------------------------------------------------
101 Procedure update_validate(p_rec in pqh_cec_shd.g_rec_type) is
102 --
103 l_proc varchar2(72) := g_package||'update_validate';
104 --
105 Begin
106 hr_utility.set_location('Entering:'||l_proc, 5);
107 --
108 -- Call all supporting business operations
109 --
110 chk_context
111 (p_context => p_rec.context,
112 p_object_version_number => p_rec.object_version_number);
113 --
114 --
115 --
116 hr_utility.set_location(' Leaving:'||l_proc, 10);
117 End update_validate;
118 --
119 -- ----------------------------------------------------------------------------
120 -- |---------------------------< delete_validate >----------------------------|
121 -- ----------------------------------------------------------------------------
122 Procedure delete_validate(p_rec in pqh_cec_shd.g_rec_type) is
123 --
124 l_proc varchar2(72) := g_package||'delete_validate';
125 --
126 Begin
127 hr_utility.set_location('Entering:'||l_proc, 5);
128 --
129 -- Call all supporting business operations
130 --
131 hr_utility.set_location(' Leaving:'||l_proc, 10);
132 End delete_validate;
133 --
134 end pqh_cec_bus;