Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

PL/SQL debugging tips

Oracle Database Tips by Donald BurlesonNovember 5,  2015

Question:  I have a PL/SQL procedure and I cannot understand why my output is wrong.  How do I debug a PL/SQL program?  Does Oracle have a PL/SQL debugging tool?  How can I manually perform PL/SQL debugging?
 

Answer: PL/SQL an interpreted language and syntax and semantic errors are discovered at compile time, and execution errors are encountered at run time.  You may see these types of PL/SQL errors:

  • Syntax errors:  These are indicated by the "Warning: Procedure created with compilation errors" message.  You can display the error with the "show errors" SQL*Plus command).
  • Semantic errors:  These are invalid table or column names.
  •  Run time errors:  This is a a non-zero Oracle database error code

PL/SQL is just like any other procedural language and you can insert display statements (using dbms_output.put_line) and step through the code and see exactly how the values of variables are changing.  This is the easiest form of PL/SQL debugging.

There are common PL/SQL debugging techniques.  For a full list of PL/SQL debugging tips and tricks, see Dr. Hall's book "Oracle PL/SQL Tuning Secrets", an amazing collection of PL/SQL tips for the professional programmer:

  • Syntax errors:  Use the "show errors" command

  • Use display statements - You can insert dbms_output.put_line and utl_file.put_line statements to display variable states.  But advanced PL/SQL can be problematic.  The display components of PL/SQL (dbms_output and utl_file) provide limited PL/SQL debugging capabilities.
     

  • Use dbms_debug - More complex instrumenting of PL/SQL can also be accomplished using the dbms_debug online debugging.
     

  • Use dbms_profiler - The dbms_profiler package can aid in PL/SQL debugging.
     

  • Conditional Compilation - In Oracle10g, PL/SQL conditional compilation is ideal for debugging PL/SQL.
     

  • PL/SQL debugger - You can use Oracle's PL/SQL debugger (part of the free SQL Developer suite) to step through the PL/SQL code, one line at a time, and find any error:
     

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.