DBA Data[Home] [Help]

PACKAGE BODY: APPS.ECX_ERROR_HANDLING_PVT

Source


1 PACKAGE BODY ECX_ERROR_HANDLING_PVT AS
2 -- $Header: ECXERRHB.pls 120.2 2006/05/24 16:26:13 susaha ship $
3 
4 l_procedure          PLS_INTEGER := ecx_debug.g_procedure;
5 l_statement          PLS_INTEGER := ecx_debug.g_statement;
6 l_unexpected         PLS_INTEGER := ecx_debug.g_unexpected;
7 l_procedureEnabled   boolean     := ecx_debug.g_procedureEnabled;
8 l_statementEnabled   boolean     := ecx_debug.g_statementEnabled;
9 l_unexpectedEnabled  boolean     := ecx_debug.g_unexpectedEnabled;
10 
11    PROCEDURE Print_Parse_Error (
12       p_err_pos        IN   PLS_INTEGER,
13       p_string         IN   VARCHAR2) IS
14 
15       i_method_name   varchar2(2000) := 'ecx_error_handling_pvt.print_parse_error';
16 
17       l_start_pos           PLS_INTEGER;
18       l_new_length          PLS_INTEGER := 100;
19       l_new_err_pos         PLS_INTEGER;
20       l_pad                 PLS_INTEGER := 50;
21 
22    BEGIN
23       if (l_procedureEnabled) then
24           ecx_debug.push(i_method_name);
25       end if;
26       if (p_err_pos > l_pad) then
27          l_start_pos := p_err_pos - l_pad;
28       else
29          l_start_pos := 0;
30       end if;
31 
32       l_new_err_pos := p_err_pos - l_start_pos + 1;
33 
34 
35       if(l_statementEnabled) then
36         ecx_debug.log(l_statement,'ECX', 'ECX_PARSING_ERROR', i_method_name,
37                      'ERROR_POSITION', l_new_err_pos );
38          ecx_debug.log (l_statement,substrb(p_string, l_start_pos, l_new_length),i_method_name);
39          ecx_debug.log (l_statement,'ECX', 'ECX_ERROR_CODE', i_method_name,'ERROR_CODE', SQLCODE);
40          ecx_debug.log (l_statement,'ECX', 'ECX_ERROR_MESSAGE',i_method_name, 'ERROR_MESSAGE', SQLERRM);
41       end if;
42 
43       if (l_procedureEnabled) then
44           ecx_debug.pop(i_method_name);
45       end if;
46    END Print_Parse_Error;
47 
48 END ECX_ERROR_HANDLING_PVT;
49