Easy ways of debugging the plsql code ??

I have a dumb question, i am just curious to know what are the different ways you use to debug a thousands of lines of pl/sql code (procedure/function etc)...it is really scary sometimes going through different variables/code/sytnax/functionality with tight timelines...is it possible for debugging purpose to see the output of the execution like what we use in unix (set -x command)..is there any similar way in Oracle...appreciate your time it really helps me to speed up my learning though i know the basics of Oracle PL/SQL just want to know opinion from peers on how they do,Thank you.

Ariean wrote:
1. Can you please provide me an example on how to read the DBMS_OUPUT static array and mail it.You need to wrap DBMS_OUPUT into a package - so your code will call the package and not the DBMS_OUPUT directly. The package header may look as follows:
create or replace package DebugOut is
  procedure Write( line varchar2 );
... other calls such as writing the call stack, error trace and so on
  (see DBMS_UTILITY for details)
end;In the package implementation, you need to count the number of times that Write() is called via a counter. The counter needs to be a static package variable. When the counter reaches the ceiling (e.g. 10,000 lines), then you reset DBMS_OUPUT buffer calling DBMS_OUPUT..disable() and then DBMS_OUPUT.enable(). For example:
create or replace package body DebugOut is
  MAX_LINES constant number := 10000;
  lineCnt number := 0;
  procedure ResetDbmsOutput is
  begin
        DBMS_OUTPUT.disable;
        lineCount := 0;
        DBMS_OUTPUT.enable( buffer_size => NULL );
  end;
  procedure Write( line varchar2 ) is
  begin
    lineCnt := lineCnt + 1;
    if lineCnt > MAX_LINES then
     ResetDbmsOutput;
    end if;
    DBMS_OUTPUT.put_line( line );
  end;
end;
2. API - does it stand for "Application programming Interface" in this context like toad ?? can you please explain more on this.Correct API means Application Programming Interface. See Wikipedia's article on API for a basic overview.
In PL/SQL we have a bunch of APIs supplied by Oracle - these APIs are implemented as PL/SQL packages. UTL_SMTP is for example an API to communicate via Simple Mail Transfer Protocol with a mail server. DBMS_PIPE is an API for IPC (Inter Process Communication), allowing PL/SQL processes to communicate with one another and coordinate processing. DBMS_LOB is an API for dealing with Large Objects (LOBs). Etc.
Likewise, a good development team will create their own APIs for services their application code often needs. For example, creating a Debug Logging API (as the very simplistic example above shows).
3. What is instrumentation / instrumentation overhead ??? Instrumentation is explained via the link I've provided. Simplistically, it records what a code unit (e.g. procedure or function) does, what parameter it received, what assertions failed, what exceptions were raised and so on.
Also have a look at Microsoft Dev Network's Introduction to Instrumentation and Tracing for additional details.
As for the overheads - instrumentation means extra code that needs to be executed while your process is executed. This code will need to use resources like memory or disk space to store/record instrumentation data.
For example, we use the above DebugOut API to record the start of a code unit and parameters passed as part of instrumenting our code. The DebugOut API consumes memory (it used the DBMS_OUTPUT buffer).
So what we can do is add a debug boolean variable to the package header of the DebugOut package. In the Write() procedure of the package, we only write to DBMS_OUTPUT when debug is true.
This now means that when debug is false, our instrumentation code does not record any data - and thus reduce resource usage. When the need arise, we can enable debug in DebugOut prior to executing our code - and now as our code executes, the instrumentation part happens and DebugOut record trace information to the DBMS_OUTPUT buffer. And we can display that trace data when our process completes in order to troubleshoot problems and process flow.

Similar Messages

  • Is there a way to automate the tax code assignation on non PO documents lik

    I'm looking for a way to automate the tax code assignation on purchases, I'm aware of the condition techniques for POs, but I would like to understand if it can be also applied to the other document in purchases so we can have a totally automate process on tax code assignation.
    Documents like: Contracts, Info records, RFQ, Scheduling agreements, Outline Agremments

    What you need to do is to create condition tables & access sequences for condition type NAVS for purchasing documents like RFQ, Contract & Scheduling agreement. You can use the document types and document category to differentiate these. Obviously this is required only if your tax determination scenario is different between different document type, if the tax code to be determined is not linked to purchasing document type, then you only one access sequence which can have parameteris like PORG, vendor if required etc. which are common to all document types.
    Once this configuration is done, then you need to maintain condition records using transaction MEK1 and maintain the tax codes as per the combination of parameters.
    In case of Info-record, it is different as it is a master data and this automatic tax determination will not work there.

  • If I've downloaded my music to an itunes library from an external hard drive and I have several duplicate songs, is there an easy way to delete the duplicate songs? Or, do I have to go through my entire library song by song to delete duplicates?

    If I've downloaded my music to an itunes library from an external hard drive and I have several duplicate songs, is there an easy way to delete the duplicate songs? Or, do I have to go through my entire library song by song to delete duplicates?

    In iTunes, File>Display Duplicates

  • After editing images in Aperture, I want to overwrite the editing to an external drive.  Is thee an easy way to "add" the new work without the  long process of backing up the whole library.

    After editing images in Aperture, I want to overwrite the new editing to a backup external drive.  Is there an easy way to "add" the new work without the  long process of backing up the whole library.

    But the Library is not a program.  I use SuperDuper, and it is smart enough to treat Finder Packages (such as the Library) as a whole bunch of files and folders, and overwrites only those that have changed.  Can't CCC be set up the same way?

  • Can I use "Adobe X Pro" to debug the java code in adobe forms?

    HI,
    Can I use "Adobe X Pro" to debug the java code in adobe forms?, if not how do i debug the java code written in the adobe form.

    I have the adobe acrobat x evaluation version installed, please find the print shot attached, I have pressed CTRL+J in the preview mode, but nothing came up.
    Am I doing something wrong..

  • I have a mac book with no CD slot and can't install PSE11 on my computer. Is there a way to redeem the serial code online?

    Is there a way to redeem the serial code to install the PhotoShop Elements 11 on to my computer? Or will i have to buy an external CD rom?

    Download the PSE11 installer from Download Photoshop Elements products | 13, 12, 11, 10

  • Is there any way to know the T-code from the screen?

    Hi friemds,
    it s a general question. but I found relavant for posting here.
    I saw our group friens giving some T-codes for spro functions (eg: SNRO, M/06), bbut how to know the transaction from path. i.e. If I go to condition types screen, there I could not see any transaction. is there any way to know the T-code from the screen?

    Hi,
    Listed here are the various ways you can find the list of transaction codes and their usage:
    Use transaction SE11 - ABAP Dictionary:
    Fill in the Database table name and click the Display button.
    - TSTC   table will contain all the Tcodes and
    - TSTCT table will contain all the Tcodes with Texts.
    Once you entered the screen, click in Top Menu - Utilities - Table contents - Display
    If you want to display all the transaction code (total - 57,048) you have to change the Fields: Maximum number of hits to 99999 (default 500).
    or
    Simply goto transaction SM01, although this tcode is to Lock/Unlock any transaction code, you can also view all the tcode available in the R/3 system from here.
    or
    Goto transaction SE93
    There are two ways where you can find the list of transaction codes in SE93.
    Method 1:
    You must be familiar with the starting characters strings for each of the R/3 application modules.
    Assuming you know that most Materials Management transaction codes start with MM.
    In the Fields: Transaction code, type in MM* and press the function key F4
    The list of transaction code starting with MM will be displayed.
    Method 2:
    On the Top Menu, click Utilities - Find - Execute and the first 500 transaction will be display.
    If want to display all the tcodes, make sure you remembered to change the Fields: Maximum no. of hits right at the bottom of the screen.
    I know a particular T Code and can enter and work on it.  How do I know what is the menu path for that T Code?
    Enter Search_SAP_Menu in the command box and when the pop box appears enter, the Tcode and it will give the nodes and menu path. 
    This is helpful only in case of SAP Menu not in case of SPRO - ie IMG.....
    Reward if Helpful,
    Regards,
    Archit.

  • Any way to see the sql code used to update DataTableModel?

    Hi,
    I'm getting an sql syntax error when I do an update on a table model.
    Is there a way to see the SQL command that Creator is using to update the database?
    Thanks!
    Rick

    This is an easy one. In your code before you do the .execute put in the following line: String tempString = tableRowSet.getCommand(). Set a break point on the line after. Start the program in debug mode. When the program hits the break point look at the value of tempString. check your sql statment.

  • Is there an easy way to count the number of albums I have in my library?

    Hi, there is probably a very easy way to find out how many albums I have in my iTunes library - but I haven't discovered it yet! (looking for something a bit like word count in MS Word document?)
    Powerbook G4 15 1.67   Mac OS X (10.4.3)   my first Mac - where have I been!?!

    Click on the Library icon in the source list Go Edit->Show Browser.
    This will split the library window into subwindows listing each genre, artist and album, at the top of these windows it will show the total for each of these categories.
    Apart from being the easiest way to count your albums, it's also a really useful way to view the library or any playlist. You can turn off the genre subwindow through the general preferences.
    Hope that helps!
    Sara.

  • Is there an easy way to clear the contents of Download Folder?

    Is there an easier way to clear out files (send to trash) from the downloads folder, other than dragging one by one? The downloads folder closes immediately upon dragging one file out.

    You do not need to invoke Finder to do this. Create a new empty Automator workflow and use the "Run Shell Script" option. Paste in the following....
    mv ~/Downloads/* ~/.Trash
    You can then save the workflow as an application, attach it as a Finder action or add it to the scripts menu, whichever you like better.
    If you would like to bypass the Trash and just completely delete the Downloads folder contents immediately, then paste in this command:
    rm -rf ~/Downloads/*

  • HT1660 is there an easy way to delete the whole itunes library and and start again. I notice there is only an add file/folder button but no remove facility

    I recently upgraded to the iphone 5 and managed to sort the transition out with little trouble but noticed when I tried to put my music on that Itunes has messed with album info and either it or me has generated several copies of the same albums over the years and it makes it quite dificult to sort it all out before reloading on the phone. To stop the chaos I had hoped to clear the library and start again but cant find a way to do it. I was hoping to sort all my music out in original files and consolidate them into a proper folder. HOw do I do this. I notice there is an add fole and folder button but no take away??? is there an easy way?

    Use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. If you have multiple references to the same files then don't send to the recycle bin. Use my DeDuper script if you don't want to do it by hand. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • Need help in executing the plsql code

    hi guys,
    below is the structure of the procedure i have created.
    CREATE OR REPLACE PROCEDURE sp_R_TrgComparisonReport
         DataDate IN      DATE DEFAULT NULL,
         Business IN OUT      VARCHAR2,
         Sector IN      VARCHAR2 DEFAULT NULL,
         SubSector IN      VARCHAR2 DEFAULT NULL,
         CUSIP IN OUT      VARCHAR2,
         DEALTICKER IN OUT      VARCHAR2,
         sFloatInd IN      VARCHAR2 DEFAULT NULL,
         RCT1 IN OUT      GLOBALPKG.RCT1
    AS
         tmpBusCount INT;
         tmpStartCount INT;
         tmpEndCount INT;
         tmpBusName VARCHAR2(30);
         tmpAlterTable VARCHAR2(500);
         tmpUpdateStr VARCHAR2(2000);
         tmpFinalStr1 VARCHAR2(1000);
         tmpFinalStr2 VARCHAR2(1000);
         Days INT;
         tmpFinalStrCMBS VARCHAR2(2000);
         tmpCusip VARCHAR2(100);
         tmpColName VARCHAR2(30);
         tmpFinalStr4 VARCHAR2(1000);
         tmpCMBSTable VARCHAR2(500);
         tmpEndCount_CMBS INT;
         tmpRating3str VARCHAR2(1000);
         Deletestr VARCHAR2(1000);
         ipos INT;
         CALLINGPROCASSIGNTEMP1 VARCHAR2(31);
         strSector VARCHAR2(2000);
         CALLINGPROCASSIGNTEMP2 VARCHAR2(29);
         strSubSector VARCHAR2(2000);
         CALLINGPROCASSIGNTEMP3 VARCHAR2(32);
         CALLINGPROCASSIGNTEMP4 VARCHAR2(28);
         CALLINGPROCASSIGNTEMP5 VARCHAR2(40);
         CALLINGPROCASSIGNTEMP6 VARCHAR2(34);
         CALLINGPROCASSIGNTEMP7 VARCHAR2(36);
         SCOPE_IDENTITY_VARIABLE INT;
         G1_COL1 TMPHOLDINGTRIGGER.DEALTICKER%TYPE;
         G1_ROWID ROWID;
         G2_COL1 TMPHOLDINGTRIGGER.CURRENT_CE%TYPE;
         G2_ROWID ROWID;
         G3_COL1 TMPHOLDINGTRIGGER.SP_RATING%TYPE;
         G3_ROWID ROWID;
         G4_COL1 TMPHOLDINGTRIGGER.MOODY_RATING%TYPE;
         G4_ROWID ROWID;
         G5_COL1 TMPHOLDINGTRIGGER.FITCH_RATING%TYPE;
         G5_ROWID ROWID;
         G6_COL1 TMPHOLDINGTRIGGER.DEAL_DESC%TYPE;
         G6_ROWID ROWID;
         G7_COL1 TMPHOLDINGTRIGGER.CUSIP_COMMENTARY%TYPE;
         G7_ROWID ROWID;
         G8_COL1 TMPHOLDINGTRIGGER.CUSIP_RANKING_DESC%TYPE;
         G8_ROWID ROWID;
         G9_COL1 TMPHOLDINGTRIGGER.BB_DEALTICKER%TYPE;
         G9_ROWID ROWID;
         G10_COL1 TMPHOLDINGTRIGGER.CLASS%TYPE;
         G10_ROWID ROWID;
         G11_COL1 TMPHOLDINGTRIGGER.RANKING%TYPE;
         G11_ROWID ROWID;
         CALLINGPROCASSIGNTEMP8 VARCHAR2(34);
         CALLINGPROCASSIGNTEMP9 VARCHAR2(39);
         CALLINGPROCASSIGNTEMP10 VARCHAR2(43);
         G12_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
         G12_ROWID ROWID;
         G13_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G13_ROWID ROWID;
         G14_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
         G14_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G14_ROWID ROWID;
         G15_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
         G15_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G15_ROWID ROWID;
         G16_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G16_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G16_ROWID ROWID;
         G17_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G17_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G17_ROWID ROWID;
         G18_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G18_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G18_ROWID ROWID;
         G19_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G19_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G19_ROWID ROWID;
         G20_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G20_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G20_ROWID ROWID;
         G21_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
         G21_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
         G21_ROWID ROWID;
         G22_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
         G22_ROWID ROWID;
    the procedure got compiled successfully.
    and i am trying to execute this procedure in this way.
    1 declare x refcursor;
    2 exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL');
    3* print x
    L> /
    i am facing errors.
    ERROR at line 3:
    ORA-06550: line 3, column 7:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    := . ( @ % ; not null range default character
    basically i am appsdba so dont have much exposure on this
    can some one please help me out
    thanks in advance.
    let me know if you need the complete code
    thanks,
    Vamshi.D

    and i am trying to execute this procedure in this way.
    declare x refcursor;
    2 exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL');
    3* print xIn SQL*plus you would run it like this:
    SQL> var x refcursor
    SQL> exec exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL')
    SQL> print xOf course that last command is going to hurl an invalid handle exception because you don't appear to have a ref cursor as an argument in your procedure's signature.
    Unless that is what is meant by RCT1 IN OUT GLOBALPKG.RCT1. In which case you need to reference your variable there:
    SQL> exec exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','',:x) If that last argument is not the ref cursor then your call is going to fail because we can't use literals as OUT parameters.
    Cheers, APC
    Blog : http://radiofreetooting.blogspot.com/

  • My computer had a virus and had to be cleaned, but I had my Mozilla bookmarks in a Word file now located on my Desktop. There should be an easy way to drag the bookmarks to the new Mozilla. Can you tell me how in simple straightforward steps? Thanks.

    Question
    My computer had a virus and had to be cleaned, but I had my Mozilla bookmarks in a Word file now located on my Desktop. I have spent hours trying to drag those bookmarks to the new Mozilla. There should be an easy way to do this. Can you tell me how in simple straightforward steps? Thanks.

    If the Word file is a document file type (.doc), you may be able to save it as a .html file, then import that .html file into Firefox.
    In Word, open the .doc file containing the Bookmarks,
    *click File > Save As,
    *in the "Save in" box, choose a Folder or location on your hard drive to save the file where you can find it later,
    *in the "Save type as" box choose ".html",
    *in the "Filename box" enter "bookmarks.html" (without the quotation marks),
    *click "Save"
    Then follow the-edmeister's instruction in Firefox:
    *Bookmarks > Organize Bookmarks -> Import & Backup - Import HTML... = from an HTML file
    *See: http://support.mozilla.com/en-US/kb/Importing%20Bookmarks%20from%20an%20HTML%20File

  • IR - easy way to change the items

    Hello,
    When you recive an invoice for a purchase order and the quantity of the GR is not the same as what was on the PO but the invoice does there is a quantity differece, the users have to manually change the items on the invoice from the quantity recived to what is on the invoice. After that we expect a credit memo.
    Is there a "easy" way to handel this if you have many items on an invoice?
       Regards
       Ann-Sofie

    Use BDC option

  • I was wondering if anyone had an easy way to edit the photos on a .swf file?

    I am trying to change out the photos on the flash photos on my homepage.  I only have the .swf files.  Is there an easy way to do this?  My web developer wants to charge a ridiculous amount to do this and I would actually rather learn how to do this versus paying someone else.  Any help would be appreciated.
    Thanks in advance.

    I thought there was a way to do this in Flash, but you can use a SWF extractor like http://www.swftools.org/
    You would have to follow the directions(documentation) as I have not used this program before. Or find another that seems easier to you, but thats what you need.
    Did you ask in the flash forum?
    Hope this helps,
    Chad Smith

Maybe you are looking for

  • HTTPS webservice in APEX 4.1.1 on 11gXE database

    Hi, I was trying to integrate APEX 4.1 with Service-Now ticketing tool. Most of the clients use Service-Now or Remedy for their incident management. Service-Now has exposed the incident details with https://demo.service-now.com/incident.do?WSDL. Use

  • FB60 - Business Place Filed

    Dear Friends, Can anyone tell me how to avoid the default Basiness Place value whneever i go to the transaction FB60? Regards, Perumal

  • Logging/nologging

    what is the usage of creating table with nologging, by default logging while creating table . kindly temme the solution

  • How to de-activate source system in BI system...?

    How to de-activate source system in BI system...? Regs, Naren..

  • Urgent need for help

    Hi folks, I really need help to solve an urgent issue. The context We are about to deliver an e-learning course made essentially with captivate lessons. The content is accessed through an html Main Menu which in turn is nested in a frameset. The reas