[Home] [Help]
PACKAGE BODY: APPS.PN_REC_EXP_LINE_PKG
Source
1 PACKAGE BODY pn_rec_exp_line_pkg AS
2 /* $Header: PNREXLHB.pls 120.1 2005/07/25 07:43:48 appldev noship $ */
3
4 -------------------------------------------------------------------------------
5 -- PROCDURE : INSERT_ROW
6 -- INVOKED FROM : insert_row procedure
7 -- PURPOSE : inserts the row
8 -- HISTORY :
9 -- 15-JUL-05 sdmahesh o Replaced base views with their _ALL table.
10 -------------------------------------------------------------------------------
11 PROCEDURE insert_row(
12 x_org_id pn_rec_exp_line.org_id%TYPE,
13 x_expense_line_id IN OUT NOCOPY pn_rec_exp_line.expense_line_id%TYPE,
14 x_expense_extract_code IN OUT NOCOPY pn_rec_exp_line.expense_extract_code%TYPE,
15 x_currency_code pn_rec_exp_line.currency_code%TYPE,
16 x_as_of_date pn_rec_exp_line.as_of_date%TYPE,
17 x_from_date pn_rec_exp_line.from_date%TYPE,
18 x_to_date pn_rec_exp_line.to_date%TYPE,
19 x_location_id pn_rec_exp_line.location_id%TYPE,
20 x_property_id pn_rec_exp_line.property_id%TYPE,
21 x_last_update_date pn_rec_exp_line.last_update_date%TYPE,
22 x_last_updated_by pn_rec_exp_line.last_updated_by%TYPE,
23 x_creation_date pn_rec_exp_line.creation_date%TYPE,
24 x_created_by pn_rec_exp_line.created_by%TYPE,
25 x_last_update_login pn_rec_exp_line.last_update_login%TYPE)
26 IS
27 l_desc VARCHAR2(100) := 'pn_rec_exp_line_pkg.insert_row';
28 BEGIN
29
30 pnp_debug_pkg.debug(l_desc ||' (+)');
31
32 INSERT INTO pn_rec_exp_line_all /*sdm14jul*/
33 (
34 org_id,
35 expense_line_id,
36 expense_extract_code,
37 currency_code,
38 as_of_date,
39 from_date,
40 to_date,
41 location_id,
42 property_id,
43 last_update_date,
44 last_updated_by,
45 creation_date,
46 created_by,
47 last_update_login)
48 VALUES(
49 x_org_id,
50 pn_rec_exp_line_s.nextval,
51 nvl(x_expense_extract_code, pn_rec_exp_line_s.currval),
52 x_currency_code,
53 x_as_of_date,
54 x_from_date,
55 x_to_date,
56 x_location_id,
57 x_property_id,
58 x_last_update_date,
59 x_last_updated_by,
60 x_creation_date,
61 x_created_by,
62 x_last_update_login
63 ) RETURNING expense_line_id, expense_extract_code INTO x_expense_line_id, x_expense_extract_code;
64
65 pnp_debug_pkg.debug(l_desc ||' (-)');
66
67 EXCEPTION
68 WHEN OTHERS THEN
69 RAISE_APPLICATION_ERROR(-20001, to_char(sqlcode));
70 app_exception.raise_exception;
71 END insert_row;
72
73 -------------------------------------------------------------------------------
74 -- PROCDURE : UPDATE_ROW
75 -- INVOKED FROM : update_row procedure
76 -- PURPOSE : updates the row
77 -- HISTORY :
78 -- 15-JUL-05 sdmahesh o Replaced base views with their _ALL table.
79 -------------------------------------------------------------------------------
80 PROCEDURE update_row(
81 x_expense_line_id pn_rec_exp_line.expense_line_id%TYPE,
82 x_expense_extract_code pn_rec_exp_line.expense_extract_code%TYPE,
83 x_currency_code pn_rec_exp_line.currency_code%TYPE,
84 x_as_of_date pn_rec_exp_line.as_of_date%TYPE,
85 x_from_date pn_rec_exp_line.from_date%TYPE,
86 x_to_date pn_rec_exp_line.to_date%TYPE,
87 x_location_id pn_rec_exp_line.location_id%TYPE,
88 x_property_id pn_rec_exp_line.property_id%TYPE,
89 x_last_update_date pn_rec_exp_line.last_update_date%TYPE,
90 x_last_updated_by pn_rec_exp_line.last_updated_by%TYPE,
91 x_creation_date pn_rec_exp_line.creation_date%TYPE,
92 x_created_by pn_rec_exp_line.created_by%TYPE,
93 x_last_update_login pn_rec_exp_line.last_update_login%TYPE)
94 IS
95 l_desc VARCHAR2(100) := 'pn_rec_exp_line_pkg.update_row';
96 BEGIN
97
98 pnp_debug_pkg.debug(l_desc ||' (+)');
99
100 UPDATE pn_rec_exp_line_all /*sdm_14jul*/
101 SET
102 expense_extract_code = x_expense_extract_code,
103 currency_code = x_currency_code,
104 as_of_date = x_as_of_date,
105 from_date = x_from_date,
106 to_date = x_to_date,
107 location_id = x_location_id,
108 property_id = x_property_id,
109 last_update_date = x_last_update_date,
110 last_updated_by = x_last_updated_by,
111 creation_date = x_creation_date,
112 created_by = x_created_by,
113 last_update_login = x_last_update_login
114 WHERE expense_line_id = x_expense_line_id;
115
116 pnp_debug_pkg.debug(l_desc ||' (-)');
117
118 EXCEPTION
119 WHEN OTHERS THEN
120 RAISE_APPLICATION_ERROR(-20001, to_char(sqlcode));
121 app_exception.raise_exception;
122 END update_row;
123
124
125 -------------------------------------------------------------------------------
126 -- PROCDURE : DELETE_ROW
127 -- INVOKED FROM : delete_row procedure
128 -- PURPOSE : deletes the row
129 -- HISTORY :
130 -- 15-JUL-05 sdmahesh o Replaced base views with their _ALL table.
131 -------------------------------------------------------------------------------
132 PROCEDURE delete_row(x_expense_line_id pn_rec_exp_line.expense_line_id%TYPE) IS
133 l_desc VARCHAR2(100) := 'pn_rec_exp_line_pkg.delete_row';
134 BEGIN
135
136 pnp_debug_pkg.debug(l_desc ||' (+)');
137
138 DELETE pn_rec_exp_line_all /*sdm14jul*/
139 WHERE expense_line_id = x_expense_line_id;
140
141 pnp_debug_pkg.debug(l_desc ||' (-)');
142
143 EXCEPTION
144 WHEN OTHERS THEN
145 RAISE_APPLICATION_ERROR(-20001, to_char(sqlcode));
146 app_exception.raise_exception;
147 END delete_row;
148
149 END pn_rec_exp_line_pkg;