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 


 

 

 


 

 

 

Linda Webb

Got breaking Oracle news?    Burleson Consulting Oracle News

Click here for more Oracle News Headlines

 


Dr. Hall on Oracle10g conditional PL/SQL compilation

Dr. Tim Hall removes the mystery of Oracle10g conditional compilation in this great article.  Hall notes that PL/SQL conditional compilation is ideal for debugging PL/SQL.

http://www.oracle-base.com/articles/10g/ConditionalCompilation_10gR2.php

As an example, let's assume that all application debugging is performed by calling a procedure called DEBUG. Conditional compilation can be used to provide an on/off switch for the debug, as well as influencing the debug information that is produced. The following procedure implements a variety of debug behavior using conditional compilation.

CREATE OR REPLACE PROCEDURE debug (p_text  IN  VARCHAR2) AS

  $IF $$debug_on $THEN

    l_text  VARCHAR2(32767);

  $END

BEGIN

  $IF $$debug_on $THEN

    $IF DBMS_DB_VERSION.VER_LE_10_1 $THEN

      l_text := SUBSTR(p_text, 1 ,233);

    $ELSE

      l_text := p_text;

    $END

    $IF $$show_date $THEN

      DBMS_OUTPUT.put_line(TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || ': ' || l_text);

    $ELSE

      DBMS_OUTPUT.put_line(p_text);

    $END

  $ELSE

    NULL;

  $END

END debug;

/

The debug_on flag acts as an on/off switch, as a value of FALSE will result in an empty procedure. Assuming debug is enabled, the DBMS_DB_VERSION package is used to determine if the input text should be truncated to prevent errors in DBMS_OUTPUT. If the code is running on a Release 2 server this truncation is not necessary due to the enhancements in the DBMS_OUTPUT package. The show_date flag is used to determine if a date prefix should be added to the debug message.


 

 
��  
 
 
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 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational