How to debugg and find wrong statements and correct in Oracle PL/SQL

Hi friends,
Any1 can guide me, how to debug oracle PL/SQL package, and have to fix bugs or changing the requirement by using toad, sometimes i resolve the problem, and i take backup in notepad, after sometime if i use the same notepad contents, the something changed, i dont no how to keep the "IF loop" correctly, Sometimes while editing, the loop nevigation changes, so that i am getting more confusions. I dont no how to correct the packages already written, and how to solve problems, i use anonymous for seeing output. Dont no how to identify and fix the bug or requirement changes,. I am not sure where the code need changes. How to test properly for fixing the bugs, and how to change the logic, any1 help me out from this,... kindly give me good solution.. thnak you in advance

Hi,
you seem a little confused with your previous posts:
956684 wrote:
Hi, Friends,
I have 4+ years experience in oracle plsql developer,
956684 wrote:I am newly changed the technology into oracle PL/SQL developer,In one (3-Sep-2012) you said you have 4+ years experienced in PL/SQL developer, in the other (17-Nov-2012) you said you are new to PL/SQL developer.
The kind of question you are posting shows that you have little experience and you have been thrown in a sort of "training on the job" which is a bit scary to my opinion.
Other users have already posted their opinion. Oracle documentation, available online is a good source of information. I've learnt a lot reading it.
But what is really important it try to work in a rational way:
a) understand business , business requirement and data model.
b) organize your job in a "safe" way. Version control is mandatory!! You cannot avoid it.
c) Be clean and organized in your coding. Spaghetti coding doesn't lead you anywhere. And never miss documenting your code.
d) Whenever you have a question constantly check Oracle documentations, Oracle forums, internet. Having web access is a great advantage of our days, you have all you need on your fingertips.
If I can give you my humble opinion, learning is a slow path. You don't become expert in one day. It's a matter of learning and experiencing day by day.
One last thing. Writing message like this:
Any1 can guide me, how to debug oracle PL/SQL package, and have to fix bugs or changing the requirement by using toad, sometimes i resolve the problem, and i take backup in notepad, after sometime if i use the same notepad contents, the something changed, i dont no how to keep the "IF loop" correctly, Sometimes while editing, the loop nevigation changes, so that i am getting more confusions. I dont no how to correct the packages already written, and how to solve problems, i use anonymous for seeing output. Dont no how to identify and fix the bug or requirement changes,. I am not sure where the code need changes. How to test properly for fixing the bugs, and how to change the logic, any1 help me out from this,... kindly give me good solution.. thnak you in advanceis not nice. Your message looks confusing, a single paragraph, approximate English.
Being clean and organized in your job is shown also in your messages. If you post your message in a clear and well written (and formatted) way you will have more chances to get an answer.
Regards.
Al

Similar Messages

  • How can i migrate Power Builder 8.0 Function into oracle PL/SQL

    Hi Oracle Experts...
    How can i migrate Power Builder 8.0 Function into oracle PL/SQL.. I had migrate some of the coding from PB to PL/SQL. But i don't know how can i convert PB structure(here structure is a data type) into oracle PL/SQL.
    Instead of structure what is the equivalent in oracle plsql
    Below i pasted my POWER BUILDER FUNCTION:
    Long ll_perd,ll_lnperd,ll_mon,ll_effmon,ll_instno,ll_odno
    Decimal{5} ldl_actual,ldl_diff,ldl_inst
    Datetime ldt_first,ldt_exp,ldt_oddt, ldt_lastprod
    String ls_instmode,ls_inst
    str_batch lstr_od //Structure to store odamt and oddate
    Select pay_c_final,lon_d_expiry, lon_d_lastprod
    Into     :ls_inst,:ldt_exp, :ldt_lastprod
    From      loan_mast
    Where branch_c_code = :gs_branch and
              act_c_type      = :as_actype and
              act_c_no           = :as_acno;
    If Sqlca.Sqlcode = -1 Then
         f_message('FT-0189',Sqlca.Sqlerrtext)
         lstr_od.batchslno = -1
         Return lstr_od
    End If
    If adt_prodt > ldt_exp Then
         Select Ceil(months_between(:adt_prodt,:ldt_exp)) Into :lstr_od.batchslno From dual;
         lstr_od.cheqdt = ldt_exp
         lstr_od.batchslno = DaysAfter(Date(ldt_lastprod), Date(adt_prodt))
    Else
         If ls_inst = 'N' Then
              If adt_prodt > ldt_exp Then
                   Select Ceil(months_between(:adt_prodt,:ldt_exp)) Into :lstr_od.batchslno From dual;
                   lstr_od.cheqdt = ldt_exp
              Else
                   lstr_od.batchslno = 1
              End If
         ElseIf ls_inst = 'Y' Then
              Select first_d_due,lon_c_instperd,lon_n_perd
              Into     :ldt_first,:ls_instmode,:ll_lnperd
              From     loan_mast
              Where branch_c_code = :gs_branch and
                        act_c_type      = :as_actype and
                        act_c_no          = :as_acno;
              If Sqlca.Sqlcode = -1 Then
                   f_message('FT-0189',Sqlca.Sqlerrtext)
                   lstr_od.batchslno = -1
                   Return lstr_od // Return Structure
              End If
              Select Ceil(months_between(:adt_prodt,:ldt_first)) Into :ll_mon from dual;
              If ll_mon > 0 Then
                   Select Nvl(ln_n_balance,0),Nvl(ln_n_instlamt,0),Nvl(ln_n_instlno,0)
                   Into     :ldl_actual,:ldl_inst,:ll_instno
                   From     loan_inst_sch
                   Where act_c_type = :as_actype and
                             act_c_no     = :as_acno and
                             ln_d_effdate = (Select Max(ln_d_effdate)
                                                           From     loan_inst_sch
                                                           Where act_c_type = :as_actype and
                                                                     act_c_no     = :as_acno and
                                                                     ln_d_effdate < :adt_prodt);
                   If Sqlca.Sqlcode = -1 Then
                        f_message('FT-0224', Sqlca.Sqlerrtext)
                        lstr_od.batchslno = -1
                        Return lstr_od
                   ElseIf Sqlca.Sqlcode = 100 Then
                        lstr_od.batchslno = 1
    *                    Return lstr_od*
                   End If
                   If adl_bal > ldl_actual Then
                        If ldl_inst > 0 Then
                             lstr_od.batchslno = (adl_bal - ldl_actual) / ldl_inst
                        End If
                   Else
                        lstr_od.batchslno = 1
                   End If     
                   If lstr_od.batchslno = 0 Then lstr_od.batchslno = 1
                   //For full OD
                   If ll_mon > ll_lnperd Then
                        lstr_od.batchslno = (ll_mon - ll_lnperd) + lstr_od.batchslno
                   End If
                   If ls_instmode = 'Q' Then
                        lstr_od.batchslno = lstr_od.batchslno * 3
                   ElseIf ls_instmode = 'H' Then
                        lstr_od.batchslno = lstr_od.batchslno * 6
                   ElseIf ls_instmode = 'Y' Then
                        lstr_od.batchslno = lstr_od.batchslno * 12
                   End If
                   Select :adt_prodt - :lstr_od.batchslno Into :lstr_od.cheqdt From dual;
                   If ls_instmode = 'M' Then
                        ll_odno = ll_instno - lstr_od.batchslno // To get OD Date
                        Select ln_d_effdate
                        Into     :lstr_od.cheqdt
                        From     loan_inst_sch
                        Where act_c_type = :as_actype and
                                  act_c_no     = :as_acno and
                                  ln_n_instlno = :ll_odno;
                        If Sqlca.Sqlcode = -1 Then
                             f_message('FT-0224', + Sqlca.Sqlerrtext)
                             lstr_od.batchslno = -1
                             Return lstr_od
                        End If
                   End If
              Else
                   lstr_od.batchslno = 1
              End If
         End If
    End if
    Return lstr_od
    Thanks in adance
    Arun M M

    What are you going to return the structure to? What I would normally use here if the code was going to be used by other PL/SQL would be a PL/SQL object type.
    However, if PowerBuilder is still in the equation (you're moving the logic to PL/SQL but keeping PowerBuilder for the GUI ), then you'll have to return something else, because PowerBuilder doesn't understand PL/SQL object types. Perhaps passing a REF CURSOR as a OUT argument and populating it from the procedure. PowerBuilder could then retrieve the result of the procedure using a stored procedure based DataWindow.

  • How to turn off Find My iPad and delete iCloud Lock on iOS 7.1.1

    How do I unlock Find My iPad or iCloud lock with out a password on iPad 2, 3, 4.  I tried once on one iPad starting from iCloud, type oooooooo, the click OK and cancel.  Then I went back to delete the word, "iCloud"  click DONE and OK.  Find My iPad wasn't deleted this time.  I think the idea is to make sure Find My iPad is off.  Then I can delete the LOCK or account that came with the device. HELP!

    Thanks for your attention.  The account's owner is unknown.
    I didn't put in detailed information.
    Believe it or not, I was able to remove iCloud lock on an iPad by hitting 8 zeros as a password (since I didn't have one)  and made sure the Find My iPad was off.  That is called a bypass.
    Needless to explain much, I am more looking for a solution to turn off Find My iPad on another iPad and I have not been successful.
    I looked up many clips on YouTube.  I wonder that Apple has updated terms and conditions with a more secured feature on iCloud.

  • I Can't download WhatsApp. I am in Dubai and asking for state and zip

    I am in UAE and i want to download whatsapp but when i give credit card details he is asking for state and Zip. Then credit card department called me and told me you are using USA website use UAE website for downloading. how can i use UAE website.

    You have to create an iTunes Account on  the iTunes UAE Store, if had an USA iTunes Account you must insert USA Address.
    Anyway here is the UAE iTunes Store Link try to create an account from there
    https://itunes.apple.com/WebObjects/MZStore.woa/wa/switchToStoreFront?l=it&store FrontId=143481
    I hope that this will help you

  • Open iphone 3gs and find serial number and dry out

    I briefly dunked my Iphone GS3 Iphone into the dog dish of water. it doesn't boot now. Had no service message . No initials like recognizing my phone.  i had it in dried rice for two days when it finally booted up this far. Do you think there is any hope to keep drying it out. It was only in water a second and i dried to outside off. I had just done cpr on my elderly mother and was nervous when i dunked it in the dog dish. 
    I am trying to open up the phone to see the sim card and take it out and the battery to help it dry out. And to talk to Apple Care. They will send me a new phone but haven't told me the cost.  i want a newer IPHONE and have to wait till May 2012 to upgrade per ATT.  My mom has a no contract phone. I am her Power of attorney. i could buy her a phone with her money. Does anyone know if i can put the phone in my name as i am only one who uses a cell phone. I am the caretaker . If i do it this way I would be paying for an att phone that doesn't work.  Am so confused. Don't know how to find serial number. i called apple they set up a call. i gave them the phone number on chat but on the online call back one is requried to insert the serial number of the phone . i can't open it up. is there a video showing how to open the phone.  Any help appreciated. Wet in Iowa. Not in San Diego anymore. Wishing I were home.

    You said, "Now how do I get the rest of the sim card out" .... With the SIM Tray out that is everything, SIM Card and Tray.
    One of the best ways to dry everything out is to continue what you were doing, let it dry in a bag of uncooked rice for several more days.

  • I am running Mountain Lion.I have searched in utilities and finder,no luck and cannot find boot camp

    I cannot find Boot Camp on my Mountain Lion. Tried utilities and finder no luck.

    Welcome to the Apple Support Communities
    Press Command and Space keys and type Boot Camp Assistant. If it doesn't work, press Command and R keys when your Mac starts and install Mountain Lion

  • How do I keep track of stats and subscriptions of my podcast? Mine was just added today.

    My podcast, The Big Seance Podcast, was just added to iTunes today. Other than keeping track of stats through my host (Libsyn), how can I keep track of subscriptions, ratings, and downloads through itunes? Thanks!

    Hi Patrick,
    You will not get any stats from Apple / iTunes.  You need to get that info from your libsyn account.
    If you want to see the number of people consuming via iTunes or the Podcasts App (AppleCoreMedia) - you will need to have the advanced stats - App 400 or greater level account in Libsyn.
    That is the only way to get the info you are looking for.
    Regards,
    Rob W

  • How do i easily find my posts and replies to them?

    '''bold text'''I find it difficult to navigate the forum.

    Another method would be to use the "'''Get email updates'''" link in the upper right corner which applies ONLY to the specific question for a page, which then has you choose between
    * '''When anybody replies''' (of most interest for the original poster (Owner))
    * '''When question is solved''' (someone not interested in possibilities until problem is solved and then will look at solution and how the thread progressed -- only the owner can mark the problem solved, so it would do no good for the owner to choose this one, if that is even possible)
    Then using the "Send Updates" button results in message "You will then notified of updates by email"
    Later the "'''Get email updates'''" links changes to "'''Stop updates'''" and you ''can'' turn off the notification for the question.
    (I've not seen a notification yet but that looks to me like how it's supposed to work.)

  • How to manipulate arrays using case statements and boolean conditions?

    In the vi that is attached I am trying to compare two values in two different arrays and delete the value that is equal to zero.  The values of each array are rounded to the closest integer.  Then I attempted to apply the ">0" boolean as the condition for my case statement, but I am getting an error.  Any tips on manipulating arrays with case statements?
    Attachments:
    Patient Movement Monitoring.vi ‏141 KB

    Thank you!!! that was a huge help. I don't think I need the case structures at all.  The next part of the code compares the 4 values in the array. 
    If columns 0 and 1 are both positive -> output 1
    If column 0 is negative and 1 is positive -> output 2
    If columns 0 and 1 are both negative -> output 3
    If column 0 is positive and 1 is negative -> output 4
    (0 is x-axis value, 1 is y-axis value.....outputs are assigning quadrants to the combination)
    Only one of the "AND" booleans will return true for each index.  Is there a way to initialize another array of outputs 1-4 depending on which AND returns true?
    Attachments:
    Patient Movement Monitoring.vi ‏144 KB

  • How to keep default Finder window size and location from Mac server

    Working in an office of three people.  Mac mini server (not sure of the OS; I think it's Snow Leopard).  We each use iMacs with Mavericks.  I have my default new Finder window set to open "customers" folder, which resides on the server, in a specific orientation.  If either of my co-workers opens "customers" and resizes that window on their machines, it retains that size & location when I open it again on my machine (as I'm sure it does to them after I "fix" my own window).
    Is there any way to change this so that one's own machine will remember the window prefs?  I mean, we're not opening on the server itself, so in my mind it should not retain the last open position, right?
    I know I could set my default folder to Home, then go to customers from the sidebar, but that almost defeats the purpose of the default folder.
    thanks in advance!!

    Hey Macdaddy,
    This happens all the time with our server at work. The server window never opens in the same place twice, and it can be annoying.
    There are third-party window management tools out there, but what I did was use a macro program called Keyboard Maestro (since I already owned it).
    Among the many things Keyboard Maestro can do is manipulate a window. I created a macro that moves it to a specific point (in my case, the upper left corner of the screen) and then resizes it to a specific width and height in pixels. I then assigned the macro a keyboard shortcut.
    Now, when I mount the server, I can use the keyboard shortcut and the window is right where I want it.
    There are other programs that just move windows, and I tried a couple. But Keyboard Maestro is more elegant in my opinion, and it does a whole lot more if you choose to go that route.
    Hope this helps.
    Andy

  • Without installing extra software how can I get finder to read and write to

    FTP accounts?

    The built-in FTP of OS X is only capable of downloading. To upload files to an FTP account requires third-party software unless you want to use the Terminal and command line. There are, however, numerous good FTP applications that are free:
    Fugu
    Son of Fugu
    NcFTP Client
    CyberDuck
    RBrowser Lite
    Excellent shareware options include:
    Transmit
    Captain FTP
    RBrowser
    Simple FTP
    Yummy FTP
    Fetch
    CrushFTP
    They can all be found at VersionTracker or MacUpdate.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • What's the best way to tag across Bridge and Finder/OSX: Images and Text?

    Hello
    I have recently successfully implemented a keyword tagging system across my companies image archive (we have a design archive), using descriptors under headings such as content, colour, theme, movement, material etc.
    This runs out of Bridge and I have found it to be an easy and cost effective way of DAM
    As this has been relatively simple to introduce, I was hoping to be able to 'tag' all of our theoretical content too. These are mostly in the form of word files and PDFs. However, obviously due to the filetypes, Adobe software doesn't allow it to be tagged in Bridge
    I have looked at the option of tagging(adding keywords) to any files (text, pdf, film) using the OpenMeta tag system in finder with the help of Default folder X which would allow to tag the non-image files, and this seems like a viable option
    However, the main usable function I would like to have at the end, is to be able search across all of our files both visual and written. So for example if I searched 'pattern' any written theory and articles would appear alongside images of pattern in the results.
    Short of paying for another piece of software, I am wondering if anyone has had experience of migrating keywords/tags into Finder from Bridge as OpenMetas in order to be able to search all of our content using Finder, or, conversely, has found a way to keyword tag non-Adobe compatible files in Bridge. We have already tagged hundreds of images using Bridge, so retagging keywords again in another software isn't really an option at this stage, I would need to just be able to transfer the info across.
    I hope this makes sense, if anyone has any ideas or experience in this that would be great
    Liv

    Hello
    I have recently successfully implemented a keyword tagging system across my companies image archive (we have a design archive), using descriptors under headings such as content, colour, theme, movement, material etc.
    This runs out of Bridge and I have found it to be an easy and cost effective way of DAM
    As this has been relatively simple to introduce, I was hoping to be able to 'tag' all of our theoretical content too. These are mostly in the form of word files and PDFs. However, obviously due to the filetypes, Adobe software doesn't allow it to be tagged in Bridge
    I have looked at the option of tagging(adding keywords) to any files (text, pdf, film) using the OpenMeta tag system in finder with the help of Default folder X which would allow to tag the non-image files, and this seems like a viable option
    However, the main usable function I would like to have at the end, is to be able search across all of our files both visual and written. So for example if I searched 'pattern' any written theory and articles would appear alongside images of pattern in the results.
    Short of paying for another piece of software, I am wondering if anyone has had experience of migrating keywords/tags into Finder from Bridge as OpenMetas in order to be able to search all of our content using Finder, or, conversely, has found a way to keyword tag non-Adobe compatible files in Bridge. We have already tagged hundreds of images using Bridge, so retagging keywords again in another software isn't really an option at this stage, I would need to just be able to transfer the info across.
    I hope this makes sense, if anyone has any ideas or experience in this that would be great
    Liv

  • Huge insert and passing insert statement in between  in oracle

    I need to generate test data , i am making use of level with dual table and want to pass commit let say after 5 records are inserted.. but the problem is that last loop iteration result incorrect inserts.. one can plz help me..
    create or replace procedure sp_test_Data_insert (i_no_records number)
    as
    l_cnt pls_integer:=1;
    l_tot pls_integer:=0;
    begin
    while l_cnt<=i_no_records
    loop
    insert into test_data
    select test_data_seq.nextval
    from (select level from dual connect by level <= l_cnt);
    dbms_output.put_line (' no.of records in loop : '|| sql%rowcount);
    l_tot:=l_tot+sql%rowcount;
    l_cnt:=l_cnt+5;
    commit;
    end loop;
    dbms_output.put_line ('Total records : '|| l_tot);
    end;
    SQL> execute sp_test_Data_insert(10);
    no.of records in loop : 1
    no.of records in loop : 6
    Total records : 7
    PL/SQL procedure successfully completed.
    issue - since third loop cnt=11, hence incorrect insert... can someone help with this...

    knowledgespring wrote:
    what if the total number of records is 1m, 10m, would you suggest make db go down or fail with lack of undo!??Clearly you do not know Oracle databases.
    10 million records is nothing to an oracle database.
    i want to pass commit in between and complete the no.of records count passed to the SP,it may be 1m, 100000,100001, 100005 , 100055, 100099...etc..
    what if this is the case!!??
    5 is just an example... and it can be 10000, 50000.. plan is to commit after every 25000 records...Committing every X number of records can cause oracle to spawn multiple write processess on the server, and more writer processes = more server resources = slower server.
    It's also transactionally inconsistent and can leave you with major headaches if a problem occurs part way through your overall business logical transaction, as you can't rollback etc.
    lack of undo is no excuse for committing out of place. resize your undo or scale your hardware according to the needs of the business, but don't write poor code that will break the database even more to try and fudge your way out of it.

  • How to track, who are using the particular table in oracle using sql or pl/

    we have database DB1 and it contains schema s1 and the schema s1 contains all the user defined objects including tables and others and it contains one of the table name called t1. we have users u1, u1, u2...uN.
    Now, I want to track who are all using that particular table t1 under schema s1 (track user, time).
    How to do this from sql OR pl/sql

    hi,
    Thanks for the url , it was useful but i am unable to extract anything from it , For ex i gave a command like this
    Audit Select, Insert, Delete
    On tk_sales_master
    By Access
    Whenever Successful;
    then
    Select * From tk_sales_master
    Then
    Select SESSIONID, ENTRYID, Statement, Timestamp#, USERID From SYS.AUD$
    But i didnt get any rows from the SYS.AUD$
    Can u pull me out
    with warm regards
    ssr

  • How to add new picklist value to states and countries to Address object

    Hi,
    I like to query and update picklists, state and country, in the address. What're the record type and filed name for them?
    I tried record type, Address and field name, State and Country, with no luck.
    Thanks

    Hi,
    As far as I know you cannot modify the address object at this point of time.
    If you want to add values or modify the picklists for State & Country, you would need to use custom fields and add all required values and then use those fields. (You can remove the Addres Object completely from the layout and then substitue it with the custom picklists that you have designed - possibly cascading picklists with Country as parent and State as child )
    Hope it helps.

Maybe you are looking for

  • ITunes could not restore the iPhone "___'s iPhone" because the backup was corrupt or not compatible

    Ok so bear with me here, it is somewhat of a long story.      I had been using an iPhone 4 for a while, with an old iTunes account that has all my stuff from over the years on it, on my computer. A week ago, I dropped by iPhone 4 in the sink and it g

  • I can't see my iPod in iTunes

    I knew this has been asked thousand times and I read the anwser and follow all steps. I uninstall and resintall, I reset my iPod, i change to another USB port, I run iPod updater. I have done all these but still, it isnt show up in iTunes nor Windows

  • Error occurred in Lockbox Processing.....

    Hello All, While running Lockbox import program in Receivables: Interfaces > Lockbox Its ending with Error. I herewith submitting the Source file, Data File and Error Logout put file. Please look into error and guide me to clear this error. Source Fi

  • Help? iTunes not playing songs?

    I tried to play a song in iTunes (version 11.1.5- newest version) but all the songs I try to play seem to get stuck on 0:00 and no audio comes out. How can I fix this? Also, things like Youtube work, so it is only the iTunes application that is not w

  • Making an entire website out of Flash

    Hi I'm new at Flash CS3 and I'm trying to make an entire website out of Flash. This is the basic concept of what I am trying to do http://www.davidmurrayweddings.com/home.php. This person's website is kind of like what I want to do with the menu butt