DBA Data[Home] [Help]

PACKAGE BODY: APPS.BSC_AW_DBMS_AW

Source


1 package body BSC_AW_DBMS_AW AS
2 /*$Header: BSCAWDBB.pls 120.4 2006/04/20 11:51 vsurendr noship $*/
3 
4 procedure execute(p_stmt varchar2) is
5 Begin
6   if g_debug then
7     bsc_aw_utility.log_s('@@ '||p_stmt);
8     bsc_aw_utility.log_s(' (S:'||bsc_aw_utility.get_time);
9   end if;
10   dbms_aw.interp_silent(p_stmt);
11   if g_debug then
12     bsc_aw_utility.log(',E:'||bsc_aw_utility.get_time||')');
13   end if;
14 Exception when others then
15   if bsc_aw_utility.is_sqlerror(sqlcode,'ignore') then
16     if g_debug then
17       bsc_aw_utility.log('Exception '||sqlcode||' ignored');
18     end if;
19   else
20     bsc_aw_utility.log('Exception in execute '||p_stmt||' '||sqlerrm);
21     raise;
22   end if;
23 End;
24 
25 --execute...but ignore exception
26 procedure execute_ne(p_stmt varchar2) is
27 Begin
28   execute(p_stmt);
29 Exception when others then
30   if g_debug then
31     bsc_aw_utility.log('This error can be ignored');
32   end if;
33 End;
34 
35 --if we need the output from aw of executing a command
36 function interp(p_stmt varchar2) return varchar2 is
37 l_clob clob;
38 l_output varchar2(10000);
39 l_length number;
40 Begin
41   if g_debug then
42     bsc_aw_utility.log_s('@@ '||p_stmt);
43     bsc_aw_utility.log_s(' (S:'||bsc_aw_utility.get_time);
44   end if;
45   l_length:=10000;
46   l_clob:=dbms_aw.interp(p_stmt);
47   dbms_lob.read(l_clob,l_length,1,l_output);
48   if g_debug then
49     bsc_aw_utility.log(',E:'||bsc_aw_utility.get_time||'), output='||l_output);
50   end if;
51   l_output:=ltrim(rtrim(l_output));
52   return l_output;
53 Exception when others then
54   if bsc_aw_utility.is_sqlerror(sqlcode,'ignore') then
55     if g_debug then
56       bsc_aw_utility.log('Exception '||sqlcode||' ignored');
57     end if;
58   else
59     bsc_aw_utility.log('Exception in interp '||p_stmt||' '||sqlerrm);
60     raise;
61   end if;
62 End;
63 
64 
65 procedure init_all is
66 Begin
67   g_debug:=bsc_aw_utility.g_debug;
68 Exception when others then
69   null;
70 End;
71 
72 END BSC_AW_DBMS_AW;