DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKC_TEMPLATE_KEYWORD_PVT

Source


1 package body okc_template_keyword_pvt as
2 -- $Header: OKCVTKWB.pls 120.2 2005/10/11 02:46:34 ndoddi noship $
3 
4 l_debug varchar2(1) := nvl(fnd_profile.value('AFLOG_ENABLED'),'N');
5 
6 retcode_success   constant varchar2(1) := '0';
7 retcode_warning   constant varchar2(1) := '1';
8 retcode_error     constant varchar2(1) := '2';
9 
10   g_pkg_name                   constant   varchar2(200) := 'OKC_TEMPLATE_KEYWORD_PVT';
11 
12   g_dbg_level							  number 		:= FND_LOG.G_CURRENT_RUNTIME_LEVEL;
13   g_proc_level							  number		:= FND_LOG.LEVEL_PROCEDURE;
14   g_excp_level							  number		:= FND_LOG.LEVEL_EXCEPTION;
15 
16 procedure sync is
17 begin
18    ad_ctx_ddl.set_effective_schema('okc');
19    ad_ctx_ddl.sync_index('okc_terms_templates_ctx');
20 exception
21 when others then raise;
22 end;
23 
24 procedure optimize is
25 begin
26    ad_ctx_ddl.set_effective_schema('okc');
27    ad_ctx_ddl.optimize_index (
28       idx_name => 'okc_terms_templates_ctx',
29       optlevel => ad_ctx_ddl.optlevel_full,
30       maxtime  => ad_ctx_ddl.maxtime_unlimited
31   );
32 exception
33 when others then raise;
34 end;
35 
36 procedure sync_ctx(errbuf out nocopy varchar2, retcode out nocopy varchar2)
37 as
38   l_api_name        constant varchar2(30) := 'concurrent_sync_ctx';
39   l_api_version     constant varchar2(30) := 1.0;
40 begin
41    /*if (l_debug = 'Y') then
42       okc_debug.set_indentation(l_api_name);
43       okc_debug.log('100: entering ',2);
44    end if;*/
45 
46    if ( g_proc_level >= g_dbg_level ) then
47 	fnd_log.string(g_proc_level,
48 	    g_pkg_name, '100: entering ');
49    end if;
50 
51    sync;
52    retcode := retcode_success;
53    /*if (l_debug = 'Y') then
54       okc_debug.log('200: leaving ',2);
55       okc_debug.reset_indentation;
56    end if;*/
57 
58    if ( g_proc_level >= g_dbg_level ) then
59 	fnd_log.string(g_proc_level,
60 	    g_pkg_name, '200: leaving ');
61    end if;
62 exception
63 when others then
64    retcode := retcode_error;
65    errbuf := substr(sqlerrm,1,200);
66    /*if (l_debug = 'Y') then
67       okc_debug.log('300: leaving ',2);
68       okc_debug.reset_indentation;
69    end if;*/
70 
71    if ( g_excp_level >= g_dbg_level ) then
72 	fnd_log.string(g_excp_level,
73 	    g_pkg_name, '300: leaving ');
74    end if;
75 end;
76 
77 procedure optimize_ctx(errbuf out nocopy varchar2, retcode out nocopy varchar2)
78 as
79   l_api_name        constant varchar2(30) := 'concurrent_optimize_ctx';
80   l_api_version     constant varchar2(30) := 1.0;
81 begin
82    /*if (l_debug = 'Y') then
83       okc_debug.set_indentation(l_api_name);
84       okc_debug.log('100: entering ',2);
85    end if;*/
86 
87    if ( g_proc_level >= g_dbg_level ) then
88 	fnd_log.string(g_proc_level,
89 	    g_pkg_name, '100: entering ');
90    end if;
91 
92    sync_ctx(errbuf, retcode);
93    if retcode <> retcode_success then
94       /*if (l_debug = 'Y') then
95          okc_debug.set_indentation(l_api_name);
96          okc_debug.log('200: leaving ',2);
97       end if;*/
98 
99       if ( g_proc_level >= g_dbg_level ) then
100 	 fnd_log.string(g_proc_level,
101 	     g_pkg_name, '200: leaving ');
102       end if;
103       return;
104    end if;
105    optimize;
106    retcode := retcode_success;
107    /*if (l_debug = 'Y') then
108       okc_debug.set_indentation(l_api_name);
109       okc_debug.log('300: leaving ',2);
110    end if;*/
111 
112    if ( g_proc_level >= g_dbg_level ) then
113       fnd_log.string(g_proc_level,
114 	  g_pkg_name, '300: leaving ');
115    end if;
116 
117 exception
118 when others then
119    retcode := retcode_error;
120    errbuf := substr(sqlerrm,1,200);
121    /*if (l_debug = 'Y') then
122       okc_debug.set_indentation(l_api_name);
123       okc_debug.log('400: leaving ',2);
124    end if;*/
125 
126    if ( g_excp_level >= g_dbg_level ) then
127       fnd_log.string(g_excp_level,
128 	  g_pkg_name, '400: leaving ');
129    end if;
130 end;
131 
132 end;