Sqlcode 100 does not come with exception

I have following query
SELECT a.col1 into v_acc_account FROM account_t a
WHERE a.col1=<input paramter> FOR UPDATE OF a.col1 NOWAIT;
The statement returns sqlcode of 100 and does not throw exception
From oracle documentation I understand that the errorcode is accompanied by an exception. What may be the reason behind this behavior.
The return code 100 explains 'DATA NOT FOUND", we have data for the select query.
Data not found means, the select is failing or the locks not available.
any help much appreciated
Regards,
Nandish

The code does not make much sense.
What is the actual problem to address - obtain a row lock using several retries with a 2 sec delay between each retry?
I would suggest a modularised approach like the following - with code that is easy to read, understand and maintain:
SQL> create or replace procedure LockEmpForUpdate(
  2          empID number,
  3          waits integer default 5,
  4          waitSecs integer default 2 ) is
  5 
  6          RESOURCE_BUSY   exception;
  7          pragma exception_init( RESOURCE_BUSY, -54 );
  8 
  9          loopCnt integer;
10          rID     rowid;
11  begin
12          loopCnt := 1;
13          while (loopCnt <= waits ) loop
14                  begin
15                          loopCnt := loopCnt + 1;
16 
17                          select
18                                  e.rowid into rID
19                          from    emp e
20                          where   e.empno = empID
21                          for update
22                          nowait;
23 
24                  exception when RESOURCE_BUSY then
25                          if loopCnt <= waits then
26                                  DBMS_LOCK.Sleep( waitSecs );
27                          end if;
28                  end;
29          end loop;
30 
31          if rID is null then
32                  raise_application_error(
33                          -20000,
34                          'Failed to obtain a row lock on employee '||empID
35                  );
36          end if;
37 
38  end;
39  /
Procedure created.
SQL>
SQL> --// this employee is locked in another session via an update
SQL> exec LockEmpForUpdate( empID => 7369 )
BEGIN LockEmpForUpdate( empID => 7369 ); END;
ERROR at line 1:
ORA-20000: Failed to obtain a row lock on employee 7369
ORA-06512: at "BILLY.LOCKEMPFORUPDATE", line 32
ORA-06512: at line 1
SQL> --// this employee is not locked
SQL> exec LockEmpForUpdate( empID => 7782 )
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • My Iphone 4 does not come with a SOFTWARE UPDATE option.

    My partner bought my iphone 4 version 4.2 about two years ago from a well known store. He got himself one at the same time but i cannot update mine because it does not come with an option in settings, general that allows me to update it. All of my apps are useless as they need at least iSO5 to run. I cannot check my bank accounts or anything. I have rung and spoke to apple many of times and followed all the steps to try and update. As this is not my fault and the iphone had not been loaded with the correct software there should be something APPLE could do free of charge!!!! I really need help as i cannot afford a replacement or want one. I just dont know what to do anymore!!

    Hi there wishheartgirl,
    You may find the information in the article below helpful.
    iOS 4: Updating your device to iOS 5 or later
    http://support.apple.com/kb/HT4972
    -Griff W. 

  • PSE 9 does not come with Camera Raw 6.2?

    Photosho Elements 9 does not come with camera raw 6.2
    , I downloaded the trial version which came with an outdated 6.1... the only version of 6.2 is for PSE8 and does not work with PSE9 how is this possible? How can they release a product with an outdated ACR????Now we have to wait for an update to a new product???Come on people!!!

    Cheap shot, Phil. Up to now, Mac users got no Organizer but a special bonus: full Bridge, full access to full featured ACR. With this version, both platforms get the same stuff -- it's less than full Photoshop/Bridge CS5, at a small fraction of the price.
    I admit, as a Mac user who shoots RAW, I liked the old trade-off...but I can understand the desire to make the two products consistent. If that makes PSE "inferior" for you than you should stick with Bridge CS4/Raw 5.7, or move up to the full-featured siblings, or switch to Lightroom.

  • Why does the iphone 5c come with a sim card taker outer and the iphone 5s does not come with one

    why does the iphone 5c come with a sim card taker outer and the iphone 5s does not come with one

    Good question... Lol, I've noticed that iPads do too... I just use a bent paperclip works like a charm.

  • I bought the ipod touch today but it does not come with a wrist loop strap

    hi there i just bought my ipod touch 5th just today and tot thet would put the loop wrist strap in but it does not come in just wandering where can i get the wrist loop strap

    The 16 GB 5G does not come with a strap.
    iPod touch
    iPod touch loop
    (sold separately for 16GB model)
    Apple EarPods
    Lightning to USB Cable
    Quick Start guide
    You can purchase a strap at an Apple store and maybe from a place like Best Buy.

  • TS1367 n't help me. anyone have any clue if this could mean me hard drive is corrupt or quit working. this model does not come with a disk or small drive t

    i have a macbook air and thos model does not come with a flas or disk to reinstall the operating system when i turn it on i get a transparent grey rolldown saying turn your computer on. does anyone have any thoughts if the hard drive is corrupt or gone out? geek squad cant help.

    Can you access the drive when you connect it to another computer?

  • How can I install a program that comes in a CD when the iMac does not come with a CD entrance?

    How can I install a program that comes in a CD when the iMac does not come with a CD entrance?

    Another option if you have access to a second Mac with a drive is to connect the two together with the iMac in Target Disk Mode,  Transferring files between two computers using FireWire, and installing from the Mac with the optical drive.
    OT

  • I bought my iPad Air in Dubai recently. It does not come with FaceTime installed. How can I install FaceTime?

    I recently bought my iPad Air in Dubai but it does not come with FaceTime installed. Is there any way I can download it?

    You can't download FaceTime. It is a preinstalled app. If you live an a country where it is restricted - that is why you do not have the app on the iPad.

  • What are the NEW features what comes with the iPhone 6, what does not come with any other iphone?

    I just bought an iphone 6, and i was wondering what NEW features the iphone 6 has what does not come of the other iphones?

    Click here for information.
    (117357)

  • It's ridiculous that the zen nano does not come with an armba

    How can this product not come with an armband for runners? That's inexcusable! Your target market for a small flash player is mainly the exercising crowd and you blow it by not including a way to use it while exercising. The neckstrap is a waste. I don't want that thing banging around while I'm putting in 5 miles. For the love of St. Pete, use your brains creative labs!

    SSR wrote:Actually I would think the number of people exercising with the player in such a way that necessitates an armband are the minority. Why increase the price of the player with accessories that the majority of people don't want? If you want an armband case simply buy one.
    Then why include it with the ZNano Plus? I know about 20 people at work who have bought the ZNano (didn't need the features the Plus has over the regular Nano) and all have complained about the lack of the armband. One guy went and bought the armband for the older MuVo unit thinking it would be the same. It wasn't, but with a little silicon caulk at one end of the holder, it now works just fine. What really stinks is that Creative have only recently offered the armband for sale to those who didn't get one with their player (http://us.creative.com/products/prod...27&product=425)

  • A new Iphone does not come with SIM? If no... Can I by a SIM in Apple Store?

    I've bought a new 5s but I did not receive it yet.  I'd like to know if it comes with SIM card or I need to buy it. In case I need to buy, can I buy it in the Apple Store?

    Zangão wrote:
    I've bought a new 5s but I did not receive it yet.  I'd like to know if it comes with SIM card or I need to buy it. In case I need to buy, can I buy it in the Apple Store?
    That depends on how you bought the phone.  A carrier linked phone will come with a sim card.    An unlocked phone usually does not have a sim card.
    Sim cards can be bought from your Cell carrier's stores. Apple does not sell sim cards.

  • The announcement Ready for BIOS update does not come with T4400c !

    I downloaded the Bios. I accomplished this steps
    1 Extract the zip file containing the BIOS upgrade to a formatted floppy disk (please see note below regarding which type of disk to use).
    2 Ensure the Notebook is connected to the mains.
    3 Turn the Notebook off.
    4 Turn the Notebook on with the F12 key. Keep the key pressed until a short beep can be heard.
    The announcement Ready for BIOS update comes not and does not get ahead not.
    How can I solve the problem?
    (http://eu.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/faq.jsp?z=234&service=EU&from=faq_selection&CFID=B IOS&FID=TRO0000000b07)

    Hi
    I think its really an oldie.
    Did you download really the compatible and right BIOS?
    I have checked Toshiba driver page and I have found BIOS version 1.00 and 1.2.
    As in the Toshiba document described you have to use the Update procedure 7.
    If it doesnt work so in my opinion you have used wrong BIOS.

  • Procedure Builder does not come with Oracle 9iDS r2 (Complete)?

    Hi All
    I have enjoyed using Procedure Builder - but did not see opportunity to install with the Developer Suite.
    Does anyone know where I could get PB? I am not interested in using the version that comes with Forms 6i...
    Thank you!

    Procedure Builder is no longer a stand alone product.
    You can still edit and debug PL/SQL procedures from inside Oracle9i Forms.
    You might also want to take a look at the PL/SQL development capabilities of Oracle9i JDeveloper.
    It gives you the ability to debug PL/SQL stored procedures and it also has a helpful code insight when you write PL/SQL code in it.
    Check out the Database Development viewlets at http://otn.oracle.com/products/jdev/viewlets/viewlet.html

  • I can import video into iMovie but the sound does not come with it.

    I tried using a digitizer with my Macbook Pro that worked very well with my G5 tower for the past 6 years.....I can see the video but get no sound. Any issues anybody can think of? I have tried switching cables, etc. I am using a firewire connection running from a VCR. It also does the same thing with a PowerPC Macbook Pro.

    I had a feeling that was it and found the website....it said would not work with Snow Leopard or even Panther. Thanks though for taking the time to help.
    Jack

  • HT1937 Hello why does my iphone 5s does not come with personal hotspot?

    Why ?

    Oh, the fact that Personal Hotspot does not appear in Settings > Celluar is not a good sign for you.
    It suggests your cellular carrier does not offer the service.
    Contact them and find out.  Not all carriers offer it.

Maybe you are looking for

  • FI-CA Incoming Payment

    Hi, In PSCD, when you post an incoming payment (transaction FP05), do you have to have FM account assignment for Cash line item? We recently upgraded our system from 4.71 to ECC 6.0. In 4.71, when we post incoming payment, there is no FM account assi

  • How to set up sharing OSX - XP : Yes I've done my homework...

    I'm trying to get iTunes' buggy sharing to work. I can honestly say it's buggy by the shear volume of unresolved issues with it if you do some basic Googling on it. Here's my situation: * I've got iTunes 8 on my Intel iMac OSX 10.4. This is where the

  • Unable to load the specified offline registry hive when rejoining the domain

    I have a Windows Server 2008 R2 Ent member server that we needed to clone. So we removed it from the domain, cloned it, and when we went back to join it to the domain it we get a error:   The Following error occurred attempting to join the domain:  

  • PR Release Duration

    Hi, I want the duration taken for release of PR. I have the PR Creation Date but not the timestamp. I have the released date and timestamp for all levels. So I need the duration for release . All this I need for a report having the below details. PR

  • Questions on Cash Journal (FBCJ)...

    Hi Guys, I plan to use cash journals (FBCJ) to manage customer payments with my client and i have a few questions... 1) Is it possible to specify a special GL indicator, on each customer payment. I went through all the CJ fields and did not find a sp