Re: HELP PLEASE -- PL/SQL 'If I'm in debugger, do this'

From: Alex Heney <heneya_at_entcf3.agw.co.bt.uk>
Date: 1997/03/26
Message-ID: <33390D5A.7A60_at_entcf3.agw.co.bt.uk>#1/1


Peter Ball wrote:
>
> Hi
> Is there any way to code a trigger so that if I'm
> running a form with the debugger on, a test on a system
> variable will be true and different actions can be coded?
> eg
> IF DEBUG.??? = 'Y' then
> procA
> ELSE
> procB
> END IF;
>

Not directly, but fairly simply indirectly. There are various built-ins which will only execute in DEBUG mode.

One of these is BREAK, which can be used in such a way as to execute a program unit (by specifying TRIGGER followed by a pl-sql block in the parameters to the command). You could run this in a WHEN-NEW-FORM-INSTANCE trigger (or anywhere else that seems suitable to you), using it to set a value in a variable, if the form is in debug-mode. You then test this variable in the code above. You could use either a global variable, or a control-block variable. The variable would, of course be initialised prior to the break statement to indicate that the form was NOT in debug-mode. It would only get reset to indicate the form IS in debug-mode if the break statement is executed.

-- 
The above posting represents the personal opinions of the author and
is not to be taken as official (or unofficial) policy or opinions of 
his employer.

Alex Heney, Living in the Global Village.
Received on Wed Mar 26 1997 - 00:00:00 CET

Original text of this message