[Home] [Help]
PACKAGE BODY: APPS.PQH_TTL_BUS
Source
1 Package Body pqh_ttl_bus as
2 /* $Header: pqttlrhi.pkb 120.1 2005/08/06 13:18:05 srajakum noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_ttl_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_template_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 -- template_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_template_id(p_template_id in number,
37 p_language in varchar2) is
38 --
39 l_proc varchar2(72) := g_package||'chk_template_id';
40 l_api_updating boolean;
41 --
42 Begin
43 --
44 hr_utility.set_location('Entering:'||l_proc, 5);
45 --
46 l_api_updating := pqh_ttl_shd.api_updating
47 (p_template_id => p_template_id,
48 p_language => p_language );
49 --
50 if (l_api_updating
51 and nvl(p_template_id,hr_api.g_number)
52 <> pqh_ttl_shd.g_old_rec.template_id) then
53 --
54 -- raise error as PK has changed
55 --
56 pqh_ttl_shd.constraint_error('PQH_TEMPLATES_TL_PK');
57 --
58 elsif not l_api_updating then
59 --
60 -- check if PK is null
61 --
62 if p_template_id is not null then
63 --
64 -- raise error as PK is not null
65 --
66 pqh_ttl_shd.constraint_error('PQH_TEMPLATES_TL_PK');
67 --
68 end if;
69 --
70 end if;
71 --
72 hr_utility.set_location('Leaving:'||l_proc, 10);
73 --
74 End chk_template_id;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |---------------------------< insert_validate >----------------------------|
78 -- ----------------------------------------------------------------------------
79 Procedure insert_validate(p_rec in pqh_ttl_shd.g_rec_type) is
80 --
81 l_proc varchar2(72) := g_package||'insert_validate';
82 --
83 Begin
84 hr_utility.set_location('Entering:'||l_proc, 5);
85 --
86 -- Call all supporting business operations
87 --
88 chk_template_id
89 (p_template_id => p_rec.template_id,
90 p_language => p_rec.language);
91 --
92 --
93 --
94 hr_utility.set_location(' Leaving:'||l_proc, 10);
95 End insert_validate;
96 --
97 -- ----------------------------------------------------------------------------
98 -- |---------------------------< update_validate >----------------------------|
99 -- ----------------------------------------------------------------------------
100 Procedure update_validate(p_rec in pqh_ttl_shd.g_rec_type) is
101 --
102 l_proc varchar2(72) := g_package||'update_validate';
103 --
104 Begin
105 hr_utility.set_location('Entering:'||l_proc, 5);
106 --
107 -- Call all supporting business operations
108 --
109 chk_template_id
110 (p_template_id => p_rec.template_id,
111 p_language => p_rec.language);
112 --
113 --
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 10);
116 End update_validate;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------< delete_validate >----------------------------|
120 -- ----------------------------------------------------------------------------
121 Procedure delete_validate(p_rec in pqh_ttl_shd.g_rec_type) is
122 --
123 l_proc varchar2(72) := g_package||'delete_validate';
124 --
125 Begin
126 hr_utility.set_location('Entering:'||l_proc, 5);
127 --
128 -- Call all supporting business operations
129 --
130 hr_utility.set_location(' Leaving:'||l_proc, 10);
131 End delete_validate;
132 --
133 end pqh_ttl_bus;