DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PERF_CMTS_PVT

Source


1 PACKAGE BODY PA_PERF_CMTS_PVT AS
2 /* $Header: PAPECTVB.pls 120.1 2005/08/19 16:38:16 mwasowic noship $ */
3 
4 g_module_name   VARCHAR2(100) := 'pa.plsql.pa_perf_cmts_pvt';
5 
6 /*==================================================================
7   PROCEDURE
8       create_comment
9   PURPOSE
10       This procedure inserts a row into the pa_perf_cmts table.
11  ==================================================================*/
12 
13 
14     PROCEDURE create_comment(
15 			     p_api_version           IN NUMBER :=  1.0,
16 			     p_init_msg_list         IN VARCHAR2 := fnd_api.g_true,
17 			     p_commit                IN VARCHAR2 := FND_API.g_false,
18 			     p_validate_only         IN VARCHAR2 := FND_API.g_true,
19 			     p_max_msg_count         IN NUMBER := FND_API.g_miss_num,
20 			     P_transaction_id        IN NUMBER,
21 			     P_COMMENT_TEXT          IN VARCHAR2,
22 			     p_commented_by          IN NUMBER,
23 			     P_comment_date          IN DATE,
24 			     x_comment_id            OUT NOCOPY NUMBER, --File.Sql.39 bug 4440895
25 			     X_RETURN_STATUS         OUT NOCOPY VARCHAR2, --File.Sql.39 bug 4440895
26 			     X_MSG_COUNT             OUT NOCOPY NUMBER, --File.Sql.39 bug 4440895
27 			     X_MSG_DATA              OUT NOCOPY VARCHAR2 ) --File.Sql.39 bug 4440895
28 IS
29 
30 l_msg_count               NUMBER := 0;
31 l_data                    VARCHAR2(2000);
32 l_msg_data                VARCHAR2(2000);
33 l_msg_index_out           NUMBER;
34 l_debug_mode              VARCHAR2(1);
35 l_rowid                   VARCHAR2(255);
36 l_debug_level2            CONSTANT NUMBER := 2;
37 l_debug_level3            CONSTANT NUMBER := 3;
38 l_debug_level4            CONSTANT NUMBER := 4;
39 l_debug_level5            CONSTANT NUMBER := 5;
40 
41 BEGIN
42 
43      -- Initialize the Error Stack
44      PA_DEBUG.init_err_stack('PA_PERF_CMTS_PVT.create_comment');
45      x_msg_count := 0;
46      x_msg_data  := NULL;
47      x_return_status := FND_API.G_RET_STS_SUCCESS;
48      l_debug_mode  := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
49 
50      IF l_debug_mode = 'Y' THEN
51           pa_debug.set_curr_function( p_function   => 'PA_PERF_CMTS_PVT.create_comment',
52                                       p_debug_mode => l_debug_mode );
53      END IF;
54 
55      IF l_debug_mode = 'Y' THEN
56           pa_debug.g_err_stage:= 'Entered PA_PERF_CMTS_PVT.create_comment';
57           pa_debug.write(g_module_name,pa_debug.g_err_stage,
58                                      l_debug_level3);
59      END IF;
60 
61      SELECT pa_perf_comments_s1.NEXTVAL
62        INTO x_comment_id
63        FROM dual;
64 
65 
66 
67      PA_PERF_CMTS_PKG.insert_row(
68         X_ROWID => l_rowid,
69         x_comment_id => x_comment_id,
70         X_perf_txn_id => P_transaction_id,
71         X_comment_text => P_comment_text,
72 	X_commented_by => P_commented_by,
73         X_comment_date => P_comment_date,
74 	X_CREATION_DATE => NULL,
75         X_CREATED_BY => NULL,
76         X_LAST_UPDATE_DATE => NULL,
77         X_LAST_UPDATED_BY => NULL,
78         X_LAST_UPDATE_LOGIN => NULL
79      );
80 
81      -- Check for business rules violations
82 
83      IF l_debug_mode = 'Y' THEN
84           pa_debug.g_err_stage:= 'Exiting PA_PERF_CMTS_PVT.create_comment';
85           pa_debug.write(g_module_name,pa_debug.g_err_stage,
86                                    l_debug_level3);
87           pa_debug.reset_curr_function;
88      END IF;
89 
90      -- Reset the Error Stack
91      PA_DEBUG.reset_err_stack;
92 
93 
94 EXCEPTION
95    WHEN others THEN
96       x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
97       x_msg_count     := 1;
98       x_msg_data      := SQLERRM;
99 
100       FND_MSG_PUB.add_exc_msg(
101        p_pkg_name        => 'PA_PERF_CMTS_PVT'
102       ,p_procedure_name  => 'CREATE_COMMENT'
103       ,p_error_text      => x_msg_data);
104 
105       IF l_debug_mode = 'Y' THEN
106           pa_debug.g_err_stage:= 'Unexpected Error: '||x_msg_data;
107           pa_debug.write(g_module_name,pa_debug.g_err_stage,
108                               l_debug_level5);
109           pa_debug.reset_curr_function;
110       END IF;
111       RAISE;
112 END create_comment;
113 
114 
115 END PA_PERF_CMTS_PVT;
116