Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL call stack

Re: PL/SQL call stack

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 11 Jan 2007 09:32:54 -0800
Message-ID: <1168536775.176279@bubbleator.drizzle.com>


cpiodumpv_at_gmail.com wrote:
>> That's not what you originally asked. You wrote:
>> "so we can log the current function/procedure executing"
>> Different question ... different answer.
>>
>> What you want instead is the DBMS_APPLICATION_INFO built-in
>> package. Look at the following procedures also documented in
>> Morgan's Library at www.psoug.org.
>>
>> DBMS_APPLICATION_INFO.READ_CLIENT_INFO
>> DBMS_APPLICATION_INFO.READ_MODULE
>> DBMS_APPLICATION_INFO.SET_ACTION
>> DBMS_APPLICATION_INFO.SET_CLIENT_INFO
>> DBMS_APPLICATION_INFO.SET_MODULE
>>
>> At the beginning of each procedure or function do a set. In your
>> exception handler do a get.
>>
>> You can also set a variable, global to the package, with the name
>> of the current code block as you enter it but then you asked for
>> a built-in package solution.
>>
>> Hope this helps.
>> --

> 
> Good point this is not what I asked.  Currently, at the beginning of
> the routine I push onto the stack encapsulated in the homegrown
> instrumentation utility and then pop at the end of the routine.  The
> goal here is to not have to do or think about pushing or popping or
> setting etc... when i am developing.  Currently, the only solution I
> see is to write my own utility that will derive the procedure/function
> name from the line number on the call stack.

I'm not sure I can agree with the concept of reinventing the wheel. Is it really that big a thing, in the first line of each procedure or function to write:

curproc := 'thisproc';

Certainly less work than writing, debugging, and maintaining an application from scratch.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Jan 11 2007 - 11:32:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US