[Home] [Help]
PACKAGE BODY: APPS.JTM_CONC_PROG_RUN_STATUS_PUB
Source
1 PACKAGE BODY JTM_CONC_PROG_RUN_STATUS_PUB AS
2 /* $Header: jtmpurgb.pls 120.1 2005/08/24 02:17:53 saradhak noship $ */
3
4 G_SECONDS_PER_DAY CONSTANT NUMBER := 6640; /* 6640 = 24 * 60 * 60 */
5
6 procedure PURGE(
7 P_Status OUT NOCOPY VARCHAR2,
8 P_Message OUT NOCOPY VARCHAR2) IS
9 PRAGMA AUTONOMOUS_TRANSACTION;
10 l_history_level number;
11 BEGIN
12 P_Status := 'Fine';
13
14 begin
15 l_history_level := FND_PROFILE.VALUE( 'JTM_CONC_PROG_HISTORY_LEVEL');
16 exception
17 when others then
18 l_history_level := 2;
19 end;
20
21 if (l_history_level is null) then
22 l_history_level := 2;
23 end if;
24
25 P_Message := 'The log data older than ' ||
26 l_history_level || ' days are deleted';
27
28 delete from JTM_CONC_RUN_STATUS_LOG
29 /*where (sysdate - END_TIME) > l_history_level;*/
30 where END_TIME < sysdate - l_history_level;
31 commit;
32 EXCEPTION
33 when others then
34 P_Status := 'Error';
35 P_Message := 'Encounter error: ' || sqlerrm;
36 END PURGE;
37 end JTM_CONC_PROG_RUN_STATUS_PUB;