Debugging PL/SQL with VS 2005

I just saw this awesome article:
http://www.oracle.com/technology/obe/odt/debugging/debugging.htm?msgid=5375573
I strongly recommend that everyone read this - this is sweet!

Hi,
Just out of curiousity, do people find this format (i.e. "article" format) preferable to the "viewlet" format?
Thanks,
Mark

Similar Messages

  • Debugging PL/SQL with [User] Types

    I am using SQL Developer 1.2.0 against Oracle 10.2.0.3.0 running on Linux. I run SQL Developer on the database server through Xterm 32 on my windows PC (too many firewalls, closed ports and a locked up db server).
    I have several Types that I use in my stored procedures. I have compiled all the Types for debug, but I still get "Opaque" for some of them in the Data tab when debugging.
    variables of this Type:
    create or replace TYPE "NUM_LIST" as table of number;
    with variable defined as:
    LineList NUM_LIST := NUM_LIST();
    I can expand the nested table variable and see each [element] and its key and value
    variables of this Type:
    create or replace type SUB_LIST as table of SUB_REC;
    with:
    create or replace type SUB_REC as object(
    STATION varchar2(5),
    FIND varchar2(10),
    REPLACE varchar2(10));
    and variable defined as:
    AllSubList SUB_LIST := SUB_LIST(NewSubRec);
    where:
    NewSubRec SUB_REC := SUB_REC('', '', '');
    I can expand the nested table variable and see each [element] and its key, but the value is OPAQUE.
    I've tried compiling for debug the objects before the tables and the tables before the objects.
    The workaround of looping through the table (array) and putting the values in a varchar to see the data is annoying at best.
    Any ideas??
    Thanks

    Oops. Am I ever embarrassed. - I just thought I had compiled all the Types but I hadn't because of the dependencies the RECs had with the LISTs.
    Sorry...
    Jean

  • Error at debug PL/SQL with object types

    Hi, can someone help me.
    My context is:
    Database: Oracle 9.2.0.5.
    O.S. Solaris 9
    SQL Developer: 1.2.1 build 3213
    I am trying to debug a package and I am getting this error:
    Connecting to the database ADMINEW_SERVICIOS.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: ALTER SESSION SET PLSQL_COMPILER_FLAGS=INTERPRETED
    Executing PL/SQL: CALL DBMS_DEBUG_JDWP.CONNECT_TCP( '10.70.10.69', '3673' )
    Debugger accepted connection from database on port 3673.
    Processing 56 classes that have already been prepared...
    Finished processing prepared classes.
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: internal error, arguments: [2603], [], [], [], [], [], [], []
    ORA-06553: PLS-707: unsupported construct or internal error [2603]
    Process exited.
    Disconnecting from the database ADMINEW_SERVICIOS.
    Debugger disconnected from database.
    When I call the debugger the parameters were:
    DECLARE
    P_SERIE VARCHAR2(200);
    P_SUSI NUMBER;
    P_EMPSUSI NUMBER;
    P_TX NUMBER;
    P_TIPO VARCHAR2(200);
    P_GRUPO NUMBER;
    P_CARGA SERVICIOS.TP_CONT;
    P_SERVICIOS SERVICIOS.TP_SERVICIOS;
    P_NUM NUMBER;
    v_Return VARCHAR2(200);
    BEGIN
    P_SERIE := 'M7';
    P_SUSI := 305;
    P_EMPSUSI := 1;
    P_TX := 153;
    P_TIPO := 'UNIFICADO';
    P_GRUPO := 48;
    -- Modify the code to initialize the variable
    P_CARGA := TP_CONT('M7', '4049', 'LLENO', '20', '15', '1500');
    -- Modify the code to initialize the variable
    P_SERVICIOS := TP_SERVICIOS(
    TP_SERVICIO('PAQUETE', 'SUSI', 'CREDITO', 'NACIONAL', NULL, '13423', '1', '89', '48', 'SI')
    P_NUM := 1;
    v_Return := PKG_TOOLS_SERVICIO_WEB.FN_ACTUALIZA_SUSI(
    P_SERIE => P_SERIE,
    P_SUSI => P_SUSI,
    P_EMPSUSI => P_EMPSUSI,
    P_TX => P_TX,
    P_TIPO => P_TIPO,
    P_GRUPO => P_GRUPO,
    P_CARGA => P_CARGA,
    P_SERVICIOS => P_SERVICIOS,
    P_NUM => P_NUM
    DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
    END;
    The type definition is:
    create or replace TYPE TP_SERVICIOS AS
    VARRAY(20) OF TP_SERVICIO;
    create or replace
    TYPE TP_SERVICIO AS OBJECT(
    /* TODO enter attribute and method declarations here */
    TIPOSERV VARCHAR2(20),
    TIPOFACT VARCHAR2(15),
    FORMAPAGO VARCHAR2(10),
    MONEDA VARCHAR2(10),
    REFERENCIA VARCHAR2(15),
    CLIENTE VARCHAR2(6),
    EMPRESA VARCHAR2(2),
    ZSECLAVE VARCHAR2(5),
    GSRCLAVE VARCHAR2(3),
    CODIFICA VARCHAR2(2),
    MEMBER FUNCTION GET_TIPOSERV RETURN VARCHAR2,
    MEMBER FUNCTION GET_TIPOFACT RETURN VARCHAR2,
    MEMBER FUNCTION GET_FORMAPAGO RETURN VARCHAR2,
    MEMBER FUNCTION GET_MONEDA RETURN VARCHAR2,
    MEMBER FUNCTION GET_REFERENCIA RETURN VARCHAR2,
    MEMBER FUNCTION GET_CLIENTE RETURN VARCHAR2,
    MEMBER FUNCTION GET_EMPRESA RETURN VARCHAR2,
    MEMBER FUNCTION GET_ZSECLAVE RETURN VARCHAR2,
    MEMBER FUNCTION GET_GSRCLAVE RETURN VARCHAR2,
    MEMBER FUNCTION GET_CODIFICA RETURN VARCHAR2
    create or replace TYPE TP_CONT AS
    OBJECT(
    /* TODO enter attribute and method declarations here */
    SERIE VARCHAR2(2),
    CLAVE VARCHAR2(10),
    ESTADO VARCHAR2(5),
    DIM VARCHAR2(2),
    CANT VARCHAR2(8),
    PESO VARCHAR2(12)
    );

    This doesnt look good. You've got an ora600 in your trace which means your database has become unstable somehow. You really need to talk with the db support folks to figure out what the problem is.
    Barry

  • Error in remote debugging pl/sql with JDeveloper 10.1.3

    I'm doing remote debugging of some of my pl/sql packages with JDeveloper and I get the following error:
    DECLARE
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL
    execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: internal error, arguments: [2603], [], [], [], [], [], [],
    ORA-06553: PLS-707: unsupported construct or internal error [2603]
    When I run this code without the debugger, everything works fine.
    Any idea how to solve this problem?
    Thanks and kind regards
    Uwe

    Hi Lee,
    thanks for your reply.
    My java_pool_size is 32M, and I found out that this seems to be sufficient (means, the pl/sql internal error does not show up) as long as some of my pl/sql packages are not compiled in DEBUG mode.
    The pl/sql package I'm debugging are owned by user A and it calls procedures of a pl/sql package that is owned by a different user B. Calling B's procedures from within A causes the error, if the packages of B are compiled in DEBUG mode. If they are compiled ordinary, debugging A's packages works fine, even with the small java_pool_size.
    During the checks I repeately increased java_pool_size up to 256M, but the problem was persisting, as long as B's packages were compiled DEBUG.
    As I get the whole picture only if A's and B's packages are debugged together, I like to ask for further help.
    Thanks and Kind Regards
    Uwe

  • Debugging PL/SQL with parameters

    Hi,
    I can successfully debug a PL/SQL procedure that takes no parameters. However when I choose a procedure that takes parameters and choose "Debug", as soon as the dialog that builds the PL/SQL block that calls my procedure opens, it displays "An error was encountered performing the requested action"
    Any ideas as to what I'm doing wrong

    Check
    http://www.oracle.com/technology/obe/obe9051jdev/plsqlobe/obeplsql.htm#t2
    Frank

  • How to debug PL/SQL functions? Passing parameter and debugger error

    Hi,
    How to debug a PL/SQL function in JDeveloper? There are two problems with it:
    1) Don't see how it's possible to pass parameters required by function call (in the dialog opening after Debug -> Debug FUNCTION_NAME)
    2) In a function returning table_name%ROWTYPE (and having a record declaration for table_name%ROWTYPE), debug gives error:
    PLS-00103: Encountered symbol "/" when expecting one of ... in line
    v_Return PL/SQL RECORD;
    Debugging procedures works as expected.
    Found a similar question without answer here:
    Debugging PL/SQL with parameters

    Check
    http://www.oracle.com/technology/obe/obe9051jdev/plsqlobe/obeplsql.htm#t2
    Frank

  • Connecting SQL Analysis Services 2005 cube with obiee 10g

    Hello experts,
    I'm trying to link an SQL Analysis Services 2005 cube with obiee 10g.
    In Oracle BI Administration, when I choose File -> Import -> From
    Multi-dimensional, I have to fill the next gaps:
    Provider Type: Analysis Services 2005
    URL: ***********
    User: blank
    Password: blank
    Before to do that, I need to create the URL path.
    To create the URL, I have followed this link.
    http://erpthings.blogspot.com/2008/08/obiee-connection-to-msas-2005-
    cube.html
    But, it hasn't worked because when I was trying to configure the HTTP
    access to SQL Server 2005 Analysis Services, we have to perform a test to ensure that it has been well configured. In IIS -> WebSites -> Default WebSites -> olap, we should browse the document called "msmdpump.dll" and this should show an xml document, but it doesn't.
    Thanks!

    Hi Alex
    It sounds like your MS data pump might not be configured correctly. First ensure that is working before trying to put the values into OBIEE. Don't worry about the 500 error - I get that too instead of an XML page.
    You can read a bit more about SSAS support on my blog here:
    http://total-bi.com/2010/12/obiee-sql-server-analysis-services-cubes/
    Here's the link to Microsoft's description of setting up msmdpump.dll
    http://technet.microsoft.com/en-us/library/cc917711.aspx
    Paul

  • Debugging PL/SQL procedures with JDeveloper ?

    Hi,
    does anyone know if it is possible to debug PL/SQL procedures and packages with JDeveloper ? I'm using a 9.0.1.2.0 database but JDeveloper returns the error "The target VB_TEST could not be started because the database version does not support debugging." when I try to debug a PL/SQL procedure.
    If it is not possible, does anyone know a good alternative ?Oracle Script Debugger is not available anymore at technet.

    I need to retrive data from PL/SQL stored procedures. I am using the DynamicSQL component (2nd workaround) to retrive data from PL/SQL stored procedures. <br><br>
    I am having some problems.<br><br>
    This is the code I am running in Fuego Studio 5.5 SP 11 Build #71108:<br><br>
    dynamicSQL as Fuego.Sql.DynamicSQL<br>
    iterator as Iterator(Any[Any])<br>
    sentence as String<br>
    implname as String<br><br>
    dynamicSQL = Fuego.Sql.DynamicSQL()<br>
    implname = "conexionORBPAU"<br>
    sentence = "var result REFCURSOR; " + <br>
    "exec :result_cursor := pkg_audbpm_bpaasig_indicador.prgetsingle(9999);";<br>
    iterator = executeQuery(DynamicSQL, sentence, implname, inParameters : []);<br><br>
    And, this is the error:<br><br>
    java.sql.SQLException: Falta el parametro IN o OUT en el indice:: 1 <br>
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br>      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)<br>
    oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1681)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3280)<br>
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)<br>
         at fuego.jdbc.FaultTolerantPreparedStatement.executeQuery(FaultTolerantPreparedStatement.java:579)<br>
         at fuegoblock.sql.DynamicSQL.executeQuery(DynamicSQL.java:340)<br>
    ...<br><br>
    This is the code of the PL/SQL in the Oracle DB:<br><br>
    CREATE OR REPLACE PACKAGE PKG_AUDBPM_BPAASIG_INDICADOR IS<br>
    TYPE cursor_type IS REF CURSOR;<br>
         FUNCTION prGetSingle<br>
         (<br>
              p_ID_ASIG_INDICADOR IN NUMBER<br>
         )<br>
         RETURN cursor_type;<br><br>
    END PKG_AUDBPM_BPAASIG_INDICADOR;<br><br>
    is my code OK? Any ideas?<br><br>
    Thanks in advance.<br>

  • Debug in sql server 2012

    Hi,
    I have 3 sql server (2005,2008,2012) In 2005 and 2008 remote debug (from sql management studio installed on the client) works without problems.
    In sql 2012 debugging only works on sql management studio installed locally, why?
    The server 2012 and the client are in the same domain, and both have the firewall disabled
    to connect to all 3 I always use the same sql server management studio 2014
    thanks!

    Hi matti157,
    As your description, you fail to use remote T-SQL Debugger in the instance of SQL Server 2012. Please help to post the error information here for analysis. Based on my research, the issue could be due to the RPC or authentication issue. You could pay attention
    to the points below to troubleshoot your issue.
    1.It is recommended to verify if the configuration of the T-SQL Debugging  was done correctly. To verify that, you can follow the steps from the link:
    http://msdn.microsoft.com/en-us/library/cc646024(v=sql.100).aspx
    2.Verify if the SQL Server Management Studio was started with Administrator permissions (Run as Administrator);
    3.Verify if the account used to connect remote to T-SQL Debugger has the right of ‘sysadmin’ on SQL Server Instance and if it is in the Local Administrators Windows Group
    4.Verify if the following services are started:
    a.TCP/IP NetBIOS Helper;
    b.Remote Registry;
    c.RPC Service;
    5.Verify if DCOM is active on the server and client. To do  that please follow the steps described in the link:
    http://technet.microsoft.com/en-us/library/cc771387.aspx.
    6.If you have intermediary devices between SQL Server and client, it is absolutely necessary to configure on this devices the  necessary rules and ports , so the communication between the SQL Server and the client not to be blocked;
    7.To verify if you have any issues with the permissions at DCOM level, you can activate the DCOM logging using the following link:
    http://support.microsoft.com/kb/892500.  To verify if the DCOM works fine you can do the test from the following article
    http://support.microsoft.com/kb/259011/en-us.
    For more information about the process, please refer to the article:
    http://blogs.technet.com/b/beatrice_popa/archive/2012/11/28/quot-unable-to-start-t-sql-debugging-could-not-attach-to-sql-server-process-on-databasename-the-rpc-server-is-unavailable-quot.aspx
    Regards,
    Michelle Li

  • Problem connecting JDBC with SQLServer 2005

    * While executing the following JDBC code with SQLServer 2005, it throws Exception
    * I dont wts wrong in my code, (Note: I have included the sqljdbc.jar in my path)
    * Pls let me know the problems in my code
    * Thanks, Following is my code and error
    CODE:
    import java.sql.*;
    public class JDBCwithJava {
         public void work() {
               // Create a variable for the connection string.
               String connectionUrl = "jdbc:sqlserver://localhost:1433;" +"databaseName=empdb";
               // Declare the JDBC objects.
               Connection con = null;
               Statement stmt = null;
               ResultSet rs = null;
               try {
                    //Load the driver
                  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                  // Establish the connection.
                  con = DriverManager.getConnection(connectionUrl);
                  System.out.println("Database Successfully Connected...!");
                  //Connection Info
                  DatabaseMetaData dm = con.getMetaData();
                 System.out.println("Driver Information");
                 System.out.println("\t Driver Name: "+ dm.getDriverName());
                 System.out.println("\t Driver Version: "+ dm.getDriverVersion ());
                 System.out.println("\n Database Information ");
                 System.out.println("\t Database Name: "+ dm.getDatabaseProductName());
                 System.out.println("\t Database Version: "+ dm.getDatabaseProductVersion());
                  // Create and execute an SQL statement that returns some data.
                  String SQL = "select  * from emptable";
                  stmt = con.createStatement();
                  rs = stmt.executeQuery(SQL);
                  // Iterate through the data in the result set and display it.
                  while (rs.next()) {
                     System.out.println(rs.getInt(1) + " " + rs.getString(2));
               // Handle any errors that may have occurred.
               catch (Exception e) {
                  e.printStackTrace();
               finally {
                  if (rs != null)
                       try {
                            rs.close();
                      catch(Exception e) {
                  if (stmt != null) try { stmt.close(); } catch(Exception e) {}
                  if (con != null) try { con.close(); } catch(Exception e) {}
         public static void main(String ar[]){
              JDBCwithJava call = new JDBCwithJava();
              call.work();
    OUTPUT with ERROR:
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at JDBCwithJava.work(JDBCwithJava.java:17)
         at JDBCwithJava.main(JDBCwithJava.java:58)* Please give me your suggestion about the above program.........

    JavaImran wrote:
    RoyGrini wrote :
    Looks like login problems. Username/password or windows authentication logon problem.        * I didnt give any UN and Pwd for my database.........And the
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)gives you a 'connection refused'
    Try with providing a SQL username/password. Maybe that will work
    - Roy

  • Problem with MSSQL 2005 maintenence plan

    Hi,
    I am facing a problem with MSSQL 2005 maintenance plan. I created a plan which takes full backup of all the db’s and in the same plan I added a clean up task which is suppose to clean all the files older that 1 day.
    To gain compression I converted this plan to lite speed. Now the problem is Backups are running fine but the clean task is not cleaning old files. The job runs fine without fail.
    Any body who has faced similar problem please let me know if have the solution ?
    Thanks in advance.
    Kishan

    Hi in this case  my date format used in backup file getutcdate() format but
    to delete files i am using this script
    Declare @sql varchar(250),@retention tinyint
    set @retention=0
    set @sql='Exec master.dbo.xp_cmdshell ''Del E:\SQL2005\Backup\*' + convert(varchar(15),getdate()-@retention,120) + '*.bak'''
    Exec (@sql)
    i also tried with getutcdate()
    but it gives the following error.
    Could Not Find \\E:\SQL2005\Backup\*2008-04-03*.bak
    why i donot understand.
    can any one give heads up.

  • Compile PL/SQL with JDEV 11g TP4 - Compile button missing ?

    Hi
    I have been working through the database development with Jdeveloper tutorial:
    http://www.oracle.com/technology/obe/obe11jdev/11/db_dev/obe_%20databasedevmt.htm
    this, as name suggests, discusses db development with jdev 11g TP4.
    However I seem to have an issue with the section named 'Creating and Debugging PL/SQL Objects in the Database'.
    In section 9 of 'creating a pl/sql package' the tutorial talks about a compile for debug button on the code editor. This essentially compiles the package against the DB, however in my Jdev, this button is does not exist. Is this just because this is only a tech preview version or is there some further config I need to do?
    Versions are..
    OS: Vista SP1
    JDEV: 11.1.1.0.0
    DB: 10.2.0.1.0
    Thanks in advance
    Will

    hi Will
    Maybe this is a beter forum for your question:
    "JDeveloper and OC4J 11g Technology Preview"
    JDeveloper and OC4J 11g Technology Preview
    success
    Jan Vervecken

  • Probs Debugging PL/SQL proc JDev903

    Im trying to debug PL/SQL functions in JDeveloper 9.0.3.
    Issue N1. In Run PL/SQL window JDev adds schema name to my function and PL/SQL block fails to compile. Im manually deleting prefix from my function and block is compiled successfully.
    Then an error happened: PLS-00302: component 'JDEV_TMP_PROC_1' must be declared
    Please advice
    Debugger attempting to connect to database.
    Executing PL/SQL: ALTER SESSION SET PLSQL_DEBUG=TRUE
    Executing PL/SQL: DECLARE
    id VARCHAR2( 30 );
    BEGIN
    id := DBMS_DEBUG.initialize( '24.27.75.30:1036303964414', 1 );
    DBMS_DEBUG.debug_on( TRUE );
    END;
    Debugger connected to database.
    Deadlock detection is not supported by the debuggee virtual machine.
    Executing PL/SQL: BEGIN MY_SCHEMA."JDEV_TMP_PROC_1"(); END;
    ORA-06550: line 1, column 11:
    PLS-00302: component 'JDEV_TMP_PROC_1' must be declared
    ORA-06550: line 1, column 7:

    JDev can debug with Oracle 8.1.7 or later.
    Is the PL/SQL you want to debug in the same schema as you are connecting? Because you mentioned schema names, I wonder if there may be a bug with trying to debug PL/SQL in a schema other than the one you are connected to. If so, can you try creating connection as the owner of the PL/SQL and see if that works?
    Thanks!
    -- Brian (JDev Team)

  • Issue with configuring Hyperion HUB 7.1.2 with SQLSERVER 2005

    Hello Experts,
    One of my customer has an issue with configuring Hyperion HUB 7.1.2 with SQLSERVER 2005.
    "We are trying to configure the SQL server 2005 database with Hyperion hub and we are unable to get the cofiguration completed. We suspect the driver class (hyperion.jdbc.sqlserver.SQLServerDriver) used in the domain.xml (path \Hyperion\HyperionHub\7.2.1\deployments\Tomcat\4.1.30\) is not helping to connect with sql server 2005. We would appreciate if you can provide new driver class which we can included while deploying the app under the web server."
    Please suggest. Thanks in advance
    Regards,
    Sonu

    Hi
    Please redeploy only the Web Server under shared service. It has to be redeployed once EPMA and others are configured.
    Thanks
    Rupak
    Mantra to Win | WinMantras.com | http://hyperion.winmantras.com

  • Debugging PL/SQL

    I am using Toad for Oracle. Is there any way within PL/SQL code to define a section or block of code as code that should only run when you are debugging PL/SQL procedures/functions?

    I think the OP wants something more like this (tested in 11g, should work from 10.2 onwards if I remember correctly):
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> create or replace procedure procedurewithdebug
      2  as
      3  begin
      4      dbms_output.put_line('Start of procedure');
      5
      6      $if $$debug $then
      7          dbms_output.put_line('Extra code section only called when $$debug is TRUE');
      8      $end
      9
    10      dbms_output.put_line('End of procedure');
    11  end procedurewithdebug;
    12  /
    Procedure created.
    SQL> set serverout on
    SQL> exec procedurewithdebug
    Start of procedure
    End of procedure
    PL/SQL procedure successfully completed.
    SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
    procedure procedurewithdebug
    as
    begin
    dbms_output.put_line('Start of procedure');
    dbms_output.put_line('End of procedure');
    end procedurewithdebug;
    Call completed.
    SQL> alter session set plsql_ccflags = 'debug:true';
    Session altered.
    SQL> alter procedure procedurewithdebug compile;
    Procedure altered.
    SQL> exec procedurewithdebug
    Start of procedure
    Extra code section only called when $$debug is TRUE
    End of procedure
    PL/SQL procedure successfully completed.
    SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
    procedure procedurewithdebug
    as
    begin
    dbms_output.put_line('Start of procedure');
    dbms_output.put_line('Extra code section only called when $$debug is TRUE');
    dbms_output.put_line('End of procedure');
    end procedurewithdebug;
    Call completed.
    SQL> alter session set plsql_ccflags = 'debug:false';
    Session altered.
    SQL>
    SQL> alter procedure procedurewithdebug compile;
    Procedure altered.
    SQL> exec procedurewithdebug
    Start of procedure
    End of procedure
    PL/SQL procedure successfully completed.Note this does not automatically detect whether a procedure is compiled for debug - you have to set a compilation directive explicitly. (There is nothing special about '$$debug' either - I could have used '$$banana'.)
    As a variation, you can also use package constants:
    SQL> create or replace package environment_settings
      2  as
      3      debug constant boolean := TRUE;
      4  end environment_settings;
      5  /
    Package created.
    SQL> create or replace procedure procedurewithdebug
      2  as
      3  begin
      4      dbms_output.put_line('Start of procedure');
      5
      6      $if environment_settings.debug $then
      7          dbms_output.put_line('Extra code section only called when environment_settings.debug is TRUE');
      8      $end
      9
    10      dbms_output.put_line('End of procedure');
    11  end procedurewithdebug;
    12  /
    Procedure created.
    SQL> exec procedurewithdebug
    Start of procedure
    Extra code section only called when environment_settings.debug is TRUE
    End of procedure
    PL/SQL procedure successfully completed.
    SQL> create or replace package environment_settings
      2  as
      3      debug constant boolean := FALSE;
      4  end environment_settings;
      5  /
    Package created.
    SQL> exec procedurewithdebug
    Start of procedure
    End of procedure
    PL/SQL procedure successfully completed.Note that PL/SQL isn't just skipping the line like an ordinary IF statement, the PL/SQL compiler is actually excluding the section at compile time:
    SQL> call dbms_preprocessor.print_post_processed_source('PROCEDURE','WILLIAM','PROCEDUREWITHDEBUG');
    procedure procedurewithdebug
    as
    begin
    dbms_output.put_line('Start of procedure');
    dbms_output.put_line('End of procedure');
    end procedurewithdebug;
    Call completed.Edited by: William Robertson on Mar 26, 2009 7:18 AM

Maybe you are looking for

  • Adobe Cloud aktivierung auf neuem Rechner

    Hallo, ich habe die Cloud abonniert und will Sie auf 2 Rechnern nutzen, Büro und Privat. Ich hatte die Cloud auf beiden Rechnern bereits aktiviert. Nun bin ich in ein anderes Büro umgezogen mit neuem Rechner. Bevor dies geschehen ist, habe ich einen

  • Problem in  Outbound IDOC from SAP R/3

    Hi, I am working on to send an IDOC from SAP R/3 to XI. I configured all necessary things as follows: 1. Created for XI in sender system -- RFC dest, PORT and a partner profile with an outbound parameters and reciever port as XI port. 2. created for

  • What is the idea of a private chat

    Hi i want to know what is the idea of private chatting? a user can chat with a user in a private room. public chat is easy. just sending the text to the server and all users can see what about sending a message to a server and then to a user and both

  • Working with single pagecode in JSF --Urgent!!

    How do i map two different jsp pages to the same pagecode? The problme is in RAD where a jsp is automatically mapped to a pagecode that gets created. there is this tag <%-- jsf:pagecode language="java" location="/JavaSource/pagecode/PageCodeOne.java"

  • TS1702 Some apps have a "+" symbol on the "free" download button in the apps store. What does the "+" symbol indicate?

    Some apps have a "+" symbol on the "free" download button in the apps store. What does the "+" symbol indicate?