The Cursor's "For Update " and " Where Current of C1" Error in Form9i

Hi,
I use a cursor with for update statement. And after it, I update the table with "where current of", then it cause the forms hanged up. But In form50 of dp2k, I can run the form successfully.
The following source code are written in a Key-Next-Item
Please help me with the problem!!!!!
declare
v_cash date;
v_entno varchar2(16);
Cursor c1 is
select proc_date,entno from loan_bank for update;
begin
open c1;
loop
fetch c1 into v_cash,v_entno;
exit when c1%NOTFOUND;
update loan_bank set proc_date=sysdate where current of c1;
end loop;
commit;
close c1;
show_alert_info('OK! Done to Proc Date');
end;

Hello there,
I'm also facing the same problem...
Have you found any solution or work-around yet?
The code i'm using is the following:
IS
CURSOR cur_autonum
IS
SELECT an_nr + 1
FROM autonum
WHERE an_kode ='ADV'
FOR UPDATE OF an_nr NOWAIT
RECORD_NOT_FOUND EXCEPTION;
RECORD_IS_LOCKED EXCEPTION;
PRAGMA EXCEPTION_INIT(RECORD_IS_LOCKED,-54);
BEGIN
OPEN cur_autonum;
FETCH cur_autonum INTO :ptperson.pe_nr;
IF cur_autonum%FOUND
THEN
UPDATE autonum
SET an_nr = :ptperson.pe_nr
WHERE CURRENT OF cur_autonum;
CLOSE cur_autonum;
ELSE
     CLOSE cur_autonum;
     RAISE RECORD_NOT_FOUND;
END IF;
EXCEPTION
WHEN RECORD_NOT_FOUND
THEN
:global.rc := fnc_alert(118);
clear_record;
previous_record;
RAISE Form_Trigger_Failure;
WHEN RECORD_IS_LOCKED
THEN
IF cur_autonum%ISOPEN
THEN
CLOSE cur_autonum;     
END IF;
:global.rc := fnc_alert(119);
clear_record;
previous_record;
RAISE Form_Trigger_Failure;
WHEN OTHERS
THEN
IF cur_autonum%ISOPEN
THEN
CLOSE cur_autonum;     
END IF;
RAISE;
END;
greetings,
Emiel

Similar Messages

  • For Update and Where Current Of -

    HI All,
    We have been using Select For Update statement with wait time (i.e in seconds) in various places inside our applications. This forces for locking those rows and we commit the work at the end of our work to ensure we release the locked rows to avoid deadlock in the application. However at times we face locks during heavy contention when running those cursors in the application.
    I have 2 questions here
    1) By using where current of do we stand to gain anything advantageous so that we gain out of it. Will it try to eliminate such row level locks said above.
    2) How to avoid locks occurring in the application while using Select For Update Statements
    Please share your thoughts and suggestions to overcome on this worrying/concerning topic.
    Thanks in advance

    ramarun wrote:
    HI All,
    We have been using Select For Update statement with wait time (i.e in seconds) in various places inside our applications. This forces for locking those rows and we commit the work at the end of our work to ensure we release the locked rows to avoid deadlock in the application. However at times we face locks during heavy contention when running those cursors in the application. FOR UPDATE exists to put locks on selected data so other processes cannot lock data between the time it is selected and processed. As you're finding there are disadvantages.
    1) By using where current of do we stand to gain anything advantageous so that we gain out of it. Will it try to eliminate such row level locks said above.WHERE CURRENT OF will save you typing when you do WHERE clauses. It should not affect locking at all
    2) How to avoid locks occurring in the application while using Select For Update Statements You don't avoid locks when using the FOR UPDATE clause because that is what its for. If you don't need to lock the data then do not use FOR UPDATE.
    Edited by: riedelme on Aug 11, 2010 5:34 AM
    Updated after sybrand's comments below. Technically using WHERE CURRENT OF shouldn't affect locking directly - rows will remain locked until the transaction is terminated. Referencing the data via the rowid will be more efficient and therefore shorten the time taken to process the transaction

  • I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    I'm trying to update my software to iTunes 10.5.2.  I click on the install button, click the Accept button, the software checks for updates, and then I am back at the original download screen.  I can't seem to get past this loop.  Any suggestions?

    If I go through the setup that you suggested, won't I screw up the existing software on my system?
    No. The iTunes installer will first uninstall the existing version of iTunes and then put in the new one. (That's actually also what happens when you use Apple Software Update to install a new version ... it just doesn't show the uninstall phase like the iTunes64Setup.exe or iTunesSetup.exe does.)

  • For Update Of &Where current of

    Can you please give answer anyone,What is main use of For update Clause and Where current of Clause?

    When you will want to lock a set of records even before you change them in your program. Oracle offers the FOR UPDATE clause of the SELECT statement to perform this locking.
    When you issue a SELECT...FOR UPDATE statement, the RDBMS automatically obtains exclusive row-level locks on all the rows identified by the SELECT statement, holding the records "for your changes only" as you move through the rows retrieved by the cursor. No one else will be able to change any of these records until you perform a ROLLBACK or a COMMIT.
    The Where Current Of statement allows you to update or delete the record that was last fetched by the cursor.

  • The apple id connected with the app store for updates and purchases is outdated and will not change with the new apple id entered on my settings. how to change?

    I have changed the apple id on my settings to reflect the current account for all our apple products.
    But this is not changing when I go to the App store to make a purchase or install updates.
    How do I get the app store connection on my IPAD to go to the apple id i am currently using.
    Obviously just changing it on the settings was not enough.

    Again, this only affects you if someone *redownloaded* content with a different ID. In my case, I emailed iTunes Store support, explained the situation, and they reset the counter.  I recommend you try the same
    If you read discussion boards, this is a significant change from a year ago, when Apple told people in the same situation to go f&$# themselves.  Clearly it's dawning on them that this is a stupid policy, and my guess is if people keep complaining they'll change it to something more reasonable.  Remember, it wasn't that long ago you couldn't re-download content at all.
    Apple can't really afford to play hardball on this. Sure, the hardcore fanboys will always say "Thank you sir, may I have another" whatever Apple throws at them,  but the rest of us will just switch to Amazon, which has none of these restrictions.

  • TS1717 Can someone inform a non-tech savy PC user how to fix a Runtime Error (R6034)? I tried to download the new I-tune update and am now getting this error.

    Now able to download new version of I-Tunes, I get a Runtime Error (R6034). I removed the version I had on my PC and am now not able to upload I-Tunes at all.

    Try Troubleshooting issues with iTunes for Windows updates.
    tt2

  • About the coupon for updates and offers

    Hello
    When I bought my mac it came with these coupons for OSX Tiger, Panther and iLife '05, the thing says for updates and offers but what kind of updates are they talking about?
    Is it possible to update from iLife 05 to iLife 06 for free or a discounted price?
    So that's all I've got to ask for
    Thanks in advance for any replies

    Unfortunately I have to agree with Wade. There was a thread on this a couple of years back and I don't recall anyone having been able to use them for anything.
    Stick the Apple on your car if you don't mind scratched paintwork
    Peter

  • Cannot upgrade my iPod Touch 3rd gen from 4.2.1 to 4.3.2. I click the button "check for updates" on iTunes and it says "This version of the iPod software (4.2.1) is the current version."

    Cannot upgrade my iPod Touch 3rd gen from 4.2.1 to 4.3.2. I click the button "check for updates" on iTunes and it says "This version of the iPod software (4.2.1) is the current version."

    1.Go to http://www.felixbruns.de/iPod/firmware/
    2.Download the iPod Touch 3G 4.3.2 Firmware to your desktop.
    3.Go to your iPod summary, then hold shift.
    4.Keep holding shift and click Restore.
    5.Go to desktop on the window that comes up and click the software.

  • HT4061 My mail will not update and stay current. Its always searching but doesn't do anthing. Any suggestions for ipad3?

    My mail will not update and stay current. Its always searching but doesn't do anthing. Any suggestions for ipad3?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of this exercise is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login. Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on some Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode.)

  • My ios7 update is frozen an says "preparing for update" and my computerkeeps saying I need to download the newest version of itunes even though I have. What can I do to fix this?

    My ios7 update is frozen an says "preparing for update" and my computerkeeps saying I need to download the newest version of itunes even though I have. What can I do to fix this?

    Go to http://www.apple.com/itunes/download and download the current version.

  • Hey. I have recently made an update on my daughters iMac, particularly update OS X 10.9.4, when finished, its still asking for update and the same update stills remarked in the apple update menu and at the App store app. Why doesn't stop asking f.ud?

    Hey. I have recently made an update on my daughters iMac, particularly the update OS X 10.9.4, when finished, its still asking for update and the same update stills remarked as ready in the apple update menu and remarked as 1 to go at the App store app. Why doesn't stop asking for update when its done like 5 times or more? Thanks for taking your time!

    If you don't already have a current backup, back up all data, then reinstall the OS.* You don't need to erase the startup volume, and you won't need the backup unless something goes wrong. If the system was upgraded from an older version of OS X, you may need the Apple ID and password you used.
    If you use FileVault 2, then before running the Installer you must launch Disk Utility and select the icon of the FileVault startup volume ("Macintosh HD," unless you gave it a different name.) It will be nested below another icon with the same name. Click the Unlock button in the toolbar and enter your login password when prompted. Then quit Disk Utility to be returned to the main Recovery screen.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    If you installed the Java runtime distributed by Apple and still need it, you'll have to reinstall it. The same goes for Xcode. All other data will be preserved.
    *The linked support article refers to OS X 10.9 ("Mavericks"), but the procedure is the same for OS X 10.7 ("Lion") and later.

  • HT4623 When I go into settings and general the option to download ios7 is not there when it then says "checking for updates" and I recieve an error

    When I go into settings and general the option to download ios7 is not there when it then says "checking for updates" and I recieve an error

    What version of iOS is the device currently running?
    In order to update over the air on the device, it must be running iOS5 or higher.

  • What are the images URI for Update , Add Applicant and unlock

    what are the images URI for Update , Add Applicant and unlock
    where can I find all images URI in OAF

    For update - updateicon_enabled.gif
    You can find all other in $OA_MEDIA derectory.
    -Anand

  • Upgraded to Mavericks and Epson scanner software was quarantined.Powered on the scanner, plugged in the USB, clicked Software Update, and clicked Update for the Epson printer software. Update occurred by I chose "not now" to a dialog and it didn't install

    Hi, upgraded to Mavericks and Epson scanner software was quarantined. Powered on the scanner, plugged in the USB, clicked Software Update, and an Epson Printer Software Update appeared in the App Store Updatees area.  Clicked Update for the Epson printer software.  During the download, I was presented with a dialog asking me if I wanted the software to be automatically installed. I chose the "not now" option and as far as the App Store in concerned the software was installed, but it has not been.  Where did this go to and how can I force it to install?  Or is there some way to force the App Store to go through the download process again.  Many thanks!   Joseph

    Solution:https://discussions.apple.com/message/23504811#23504811
    Epson install: http://www.epson.com/cgi-bin/Store/support/SupportMavericksDetails.jsp?BV_UseBVC ookie=yes&oid=139863#stage1
    Epson Image Capture instructions: http://www.epson.com/cgi-bin/Store/support/supDetail.jsp?BV_UseBVCookie=yes&oid= 237343&foid=244523&infoType=FAQ

  • Are replacement (or compatible) pads for the headphones MDR-RF925RK available and where?

    Are replacement (or compatible) pads for the headphones MDR-RF925RK available and where?
    Solved!
    Go to Solution.

    The supplied 840RX ZZ ear pad is no longer available but we do have the compatible  860 RX ear pad currently in stock at our Parts and Accessories website. 
    If my post answers your question, please mark it as "Accept as Solution"

Maybe you are looking for