A script-enabled browser is required for this page to function properly.

DEBUG.GETX built-in procedure

This procedure retrieves the value of the specified local variable.

Syntax

FUNCTION DEBUG.GETC (varname VARCHAR2)
RETURN VARCHAR2;
FUNCTION DEBUG.GETD (varname VARCHAR2)
RETURN DATE;
FUNCTION DEBUG.GETI (varname VARCHAR2)
RETURN PLS_INTEGER;
FUNCTION DEBUG.GETN (varname VARCHAR2)
RETURN NUMBER;

Parameter

Description

varname

A VARCHAR2 or CHAR (DEBUG.GETC converts CHAR values to VARCHAR2), DATE, PLS_INTEGER, or NUMBER variable.

Usage notes

This is useful when you want to determine a local's value from within a debug trigger.

Examples


/*
** Retrieve the value of the variable 'my_ename'
** and use it to test a condition
*/
IF DEBUG.GETC ('my_ename') = 'JONES' THEN
RAISE DEBUG.BREAK;
END IF;

You have a program unit foo that calls the subprogram bar. That subprogram (bar) is also called by many other program units. Consider the situation where procedure bar accepts the argument 'message' from the many procedures that call it. Procedure foo passes a unique argument of 'hello world' to bar. In this case, we could define a trigger that raises a breakpoint in procedure bar only when foo passes its argument:


PL/SQL> .TRIGGER PROC bar LINE 3 IS
>BEGIN
> IF DEBUG.GETN('message') = 'hello world' THEN
> RAISE DEBUG.BREAK;
> END IF;
>END;

See also

About the DEBUG built-in package

DEBUG built-in package