Debugging in TOAD

In this forum Oracle Applications DBA's, System Administrators & Developers can share their knowledge/issues.
Post Reply
admin
Posts: 2080
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Debugging in TOAD

Post by admin »

1. DBMS_DEBUG should be in SYS schema

2. Version check - Oracle Probe API v2.0 or greater required

declare
probe_major_ver varchar2(10);
probe_minor_ver varchar2(10);
begin
dbms_debug.probe_version(probe_major_ver, probe_minor_ver);
dbms_output.put_line('MAJOR=' || probe_major_ver);
dbms_output.put_line('MINOR=' || probe_minor_ver);
end;

MAJOR=2
MINOR=5

3. grant DEBUG CONNECT SESSION


-- Demo Procedure for debugging practice

CREATE OR REPLACE PROCEDURE erpstuff_proc (p_value NUMBER)
IS
tmpVar NUMBER;
/******************************************************************************
NAME: erpstuff_proc
PURPOSE:

REVISIONS:
Ver Date Author Description
--------- ---------- --------------- ------------------------------------
1.0 1/4/2021 Sikandar Hayat 1. Created this procedure.

NOTES:

Automatically available Auto Replace Keywords:
Object Name: erpstuff_proc
Sysdate: 1/4/2021
Date and Time: 1/4/2021, 7:24:21 AM, and 1/4/2021 7:24:21 AM
Username: Sikandar Hayat
Table Name: (set in the "New PL/SQL Object" dialog)

******************************************************************************/
BEGIN
TMPVAR := P_VALUE;

DBMS_OUTPUT.PUT_LINE ('p_value = ' || p_value);

FOR i IN 1 .. 10
LOOP
tmpVar := tmpVar * i;
DBMS_OUTPUT.PUT_LINE ('tmpVar = ' || tmpVar);
END LOOP;

DBMS_OUTPUT.PUT_LINE ('The End.');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END erpstuff_proc;
/

Demonstration Video to show Debugging in Toad for Oracle
https://youtu.be/Dai9ejdM13g
Malik Sikandar Hayat
Oracle ACE Pro
info@erpstuff.com
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests