DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_CTL_BUS

Source


1 Package Body pqh_ctl_bus as
2 /* $Header: pqctlrhi.pkb 120.2 2011/04/28 09:40:38 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_ctl_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_transaction_category_id >------|
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 --   transaction_category_id 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_transaction_category_id
37                (p_transaction_category_id                in number,
38                            p_language       in varchar2) is
39   --
40   l_proc         varchar2(72) := g_package||'chk_transaction_category_id';
41   l_api_updating boolean;
42   --
43 Begin
44   --
45   hr_utility.set_location('Entering:'||l_proc, 5);
46   --
47   l_api_updating := pqh_ctl_shd.api_updating
48     (p_transaction_category_id                => p_transaction_category_id,
49      p_language       => p_language);
50   --
51   if (l_api_updating
52      and nvl(p_transaction_category_id,hr_api.g_number)
53      <>  pqh_ctl_shd.g_old_rec.transaction_category_id) then
54     --
55     -- raise error as PK has changed
56     --
57     pqh_ctl_shd.constraint_error('PQH_TXN_CATEGORIES_TL_PK');
58     --
59   elsif not l_api_updating then
60     --
61     -- check if PK is null
62     --
63     if p_transaction_category_id is not null then
64       --
65       -- raise error as PK is not null
66       --
67       pqh_ctl_shd.constraint_error('PQH_TXN_CATEGORIES_TL_PK');
68       --
69     end if;
70     --
71   end if;
72   --
73   hr_utility.set_location('Leaving:'||l_proc, 10);
74   --
75 End chk_transaction_category_id;
76 --
77 -- ----------------------------------------------------------------------------
78 -- |---------------------------< insert_validate >----------------------------|
79 -- ----------------------------------------------------------------------------
80 Procedure insert_validate(p_rec in pqh_ctl_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_transaction_category_id
90   (p_transaction_category_id          => p_rec.transaction_category_id,
91    p_language => p_rec.language);
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_ctl_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_transaction_category_id
111   (p_transaction_category_id          => p_rec.transaction_category_id,
112    p_language => p_rec.language);
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_ctl_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_ctl_bus;