DBA Data[Home] [Help]

PACKAGE BODY: APPS.CAC_NOTE_PURGE_PUB

Source


1 PACKAGE BODY CAC_NOTE_PURGE_PUB AS
2 /* $Header: cacntprb.pls 120.3 2005/09/13 10:49:41 abraina noship $ */
3 /*=======================================================================+
4  |  Copyright (c) 2002 Oracle Corporation Redwood Shores, California, USA|
5  |                            All rights reserved.                       |
6  +=======================================================================+
7  | FILENAME                                                              |
8  |   cacntprb.pls                                                        |
9  |                                                                       |
10  | DESCRIPTION                                                           |
11  |   - This package is implemented for Notes purge program that would be |
12  |     called from TASK or SR.                                           |
13  |                                                                       |
14  | NOTES                                                                 |
15  |                                                                       |
16  | Date         Developer             Change                             |
17  | ----------   ---------------       -----------------------------------|
18  | 08-08-2005   Abhinav Raina         Created                            |
19  +======================================================================*/
20 
21   Procedure purge_notes(
22       p_api_version           IN   NUMBER,
23       p_init_msg_list         IN   VARCHAR2 DEFAULT fnd_api.g_false,
24       p_commit                IN   VARCHAR2 DEFAULT fnd_api.g_false,
25       x_return_status         OUT  NOCOPY VARCHAR2,
26       x_msg_data              OUT  NOCOPY VARCHAR2,
27       x_msg_count             OUT  NOCOPY NUMBER,
28       p_processing_set_id     IN   NUMBER,
29       p_object_type           IN   VARCHAR2 )
30 
31       IS
32 
33       l_api_version	 CONSTANT NUMBER := 1.0;
34       l_api_name	 CONSTANT VARCHAR2(30) := 'PURGE_NOTES';
35 
36   BEGIN
37 
38      SAVEPOINT purge_notes;
39      x_return_status := fnd_api.g_ret_sts_success;
40 
41      IF NOT fnd_api.compatible_api_call (
42 		l_api_version,
43 		p_api_version,
44 		l_api_name,
45 		g_pkg_name
46 	     )
47      THEN
48 	  RAISE fnd_api.g_exc_unexpected_error;
49      END IF;
50 
51      IF fnd_api.to_boolean (p_init_msg_list)
52      THEN
53 	  fnd_msg_pub.initialize;
54      END IF;
55 
56      --Logging input parameters
57 
58      IF( FND_LOG.LEVEL_EXCEPTION >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
59 	 FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' p_object_type= '||p_object_type);
60          FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' p_processing_set_id= '||p_processing_set_id);
61      END IF;
62 
63 
64      --Calling the CAC_NOTE_PURGE_PVT.PURGE_NOTES API
65 
66              CAC_NOTE_PURGE_PVT.PURGE_NOTES (
67                       p_api_version        => p_api_version ,
68                       p_init_msg_list      => p_init_msg_list,
69                       p_commit             => p_commit,
70                       x_return_status      => x_return_status,
71                       x_msg_data           => x_msg_data,
72                       x_msg_count          => x_msg_count,
73                       p_processing_set_id  => p_processing_set_id,
74                       p_object_type        => p_object_type ) ;
75 
76 
77      IF NOT (x_return_status = fnd_api.g_ret_sts_success)
78      THEN
79         x_return_status := fnd_api.g_ret_sts_unexp_error;
80         RAISE fnd_api.g_exc_unexpected_error;
81      END IF;
82 
83      IF fnd_api.to_boolean (p_commit)
84      THEN
85        COMMIT WORK;
86      END IF;
87 
88      fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
89 
90   EXCEPTION
91     WHEN fnd_api.g_exc_unexpected_error
92     THEN
93 	ROLLBACK TO purge_notes;
94         x_return_status := fnd_api.g_ret_sts_unexp_error;
95         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
96       IF( FND_LOG.LEVEL_EXCEPTION >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
97         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_return_status= '||x_return_status);
98         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_msg_data= '||x_msg_data);
99         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_msg_count= '||x_msg_count);
100       END IF;
101 
102     WHEN OTHERS
103     THEN
104         ROLLBACK TO purge_notes;
105         fnd_message.set_name ('JTF', 'CAC_NOTE_UNKNOWN_ERROR');
106         fnd_message.set_token ('P_TEXT', SQLCODE || SQLERRM);
107         fnd_msg_pub.add;
108         x_return_status := fnd_api.g_ret_sts_unexp_error;
109         fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data);
110       IF( FND_LOG.LEVEL_EXCEPTION >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
111         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_return_status= '||x_return_status);
112         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_msg_data= '||x_msg_data);
113         FND_LOG.STRING(FND_LOG.LEVEL_EXCEPTION,'cac_note_purge_pub.purge_notes', ' x_msg_count= '||x_msg_count);
114       END IF;
115 
116  END purge_notes;
117 
118 END;