Databases Reference
In-Depth Information
The irst statement in the code is to signal the beginning of the stored procedure—
note the use of the local constant as being passed in the p_scope parameter, followed
by recording the names, and values of the parameters with which this procedure
was being called. The actual code is to be illed in on the three dots. The last line of
code should be a line signaling the end of the procedure. If you are using a function
instead of a procedure, the returned value should be logged prior to the inal return
statement. The last part of the template will look as follows, in the case of a function:
logger.log_information
(p_text => 'Return Value: '||l_retval
,p_scope => l_proc
);
logger.log (p_text => 'End'
,p_scope => l_proc
);
return l_retval;
end;
Using the Logger facility from your APEX application, the usage is slightly different.
It is not advisable to use elaborate PL/SQL code in the APEX application itself
use calls to stored database code instead. This centralizes the source code, which
facilitates re-use.
begin
logger.log (' ** Call the Stored Procedure');
package.procedure (p_parameter => 'Hello');
end;
If needed, you can also store the items and values in the Logger tables:
logger.log_apex_items('Debug the called Stored Procedure');
A very handy view to query the Logger tables, is logger_logs_5_min . This view
shows you all the logging statements that happened in the last ive minutes. When
you run into something you can't explain yet, this view will help in identifying
which code path was taken and where it went wrong. There is also a similar view
that shows the last 60 minutes worth of logger data. To query the APEX items and
values, you need to query logger_logs_apex_items .
 
Search WWH ::




Custom Search