Forms quits when this pl/sql code is ran.....please help!

PROCEDURE procJob IS
CURSOR c1(staff_in NUMBER) IS
SELECT staffid
FROM jobHist
WHERE staffid = staff_in
FOR UPDATE OF todate;
c1_rec jobHist.staffid%TYPE;
n number;
i number;
BEGIN
OPEN c1(:STAFF.STAFFID);
loop
fetch c1 into c1_rec;
exit when c1%notfound;
end loop;
n := c1%rowcount;
CLOSE c1;
i := 0;
OPEN c1(:STAFF.STAFFID);     
WHILE i <= n LOOP
     i := i + 1;
     FETCH c1 INTO c1_rec;
     EXIT WHEN c1%NOTFOUND;
     IF i = n THEN
     UPDATE jobHist SET todate = to_date(SYSDATE,'DD- MM-YYYY') WHERE CURRENT OF c1;
     END IF;
END LOOP;
CLOSE c1;
END;
The above code is ran from a button press and is intended to get the last record in the cursor and update the corresponding record in the jobHist table.
I think this is too complex for what I want done. Is there any way of counting the amount of records in a form data block and then going to the last one and updating it???????
thanks

Michael,
I am not sure I understood your problem.
what do you mean with last record?.
last entered in the table according to the date?.
1.suggestion: you can change the order of the block data, order by date descending or ascending...then you 'll get the required record for update at the first position. then you dont need to loop until last record.
2. suggestion: you can loop trough all records in a block
and You test the system varibale ":system.last_record"
if true or not...if true update the record.
Use the built-in routines: first_record; down
Hope this hepls,
CB

Similar Messages

  • IIllustrator quits when i try to save any file. please HELP.

    i been working on file for nearly a week now. and i save it intermitently. but as i was tryingto save the final copy it gave a an error:
    The specified module could not be found. C:\Program Files\Common Files\Adobe\Adobe Version Cue CS4\Client\4.0.0\VersionCueUI.DLL.
    Please HELP.
    and now i cant save any file big or small. i have submitted several crash report to adobe. but nothing. i have reasonably good system. please help me. will appreaciate it.

    I wanted to thank Wade zimmerman and mylenium for you efforts and quick replies, much appreciated. and thanx alot. now the problem is solved so far as  i am concerned anyways. i had to go the extreme to reinstall the whole Adobe CS4 suite. and download couple of tools from adobe/support/knowledgebase. site. here are the links if someone is having similar issues.
    http://support.microsoft.com/kb/290301
    first i downloaded this microsoft removal tool which adobe recommends it as well.
    then i restarted my system. then after i also ran the dobe cleanup script.
    here is the link:
    http://www.adobe.com/support/contact/cs4clean.html
    all of this is on the adobe support webpage.
    .. last but not least again .. thanx to Wade zimmerman and Mylenium.

  • Mail Quits when Checking for New Mail...Please Help!

    Hi, everyone. I just upgrade a Powerbook to Tiger and Mail 2.0.5. I have set up a new account, but for some reason, every time it tries to check mail, it crashes! When I bring up the activity viewer, I can see that it's logging into my mail server, and reading the number of mail messages. It then begins to download the first piece of mail, and starts applying the rules. And that's when I get the crash and the "mail has quit unexpectedly" window.
    I've already deleted all rules and turned off the junk filters, but it still continues to do it. I've also tried trashing the mail preference file, to no avail. I am at a frustrated loss here. If anyone could help, I'd appreciate it. Thanks in advance...
    Bill

    Hi there,
    Yes, I've had the same problem with Mail quitting whilst downloading new mail for around a month. I called the Applecare line and they advised me to re-install Mail. I felt this was alittle drastic as Mail worked perfectly in every other way so I didn't take their advice.
    However, thank you so much - your advice of turning off the Junk mail filter worked perfectly and in an instant my Mail works perfectly again.
    Thank you!

  • When I download the digital copy of the Hunger Games, it stops at 4.0GB and first returns an error code -1309 and then the code -50. Please help me complete the download.

    When I download the digital copy of the Hunger Games, it stops at 4.0GB and first returns an error code -1309 and then the code -50. Please help me complete the download. I have tried removing the .tmp folder and downloading it again, but each time it stops the download in the same place.

    I discovered the solution. The external drive I was saving it to was formatted as FAT32. In that format, the largest files can only be 4GB, which explains why it kept stopping at 4GB. I backed up all the files then reformatted it as Mac OS Extended (Journaled), this is possible since I am on an iMac.

  • I have downloaded a Maverick OS X 10.9.4 and installed it on my Mac from a USB, and i can't receive a Verification Code via SMS when setting up the iCloud Keychain. Please help

    I have downloaded a Maverick OS X 10.9.4 and installed it on my Mac from a USB, and i can't receive a Verification Code via SMS when setting up the iCloud Keychain. Please help.

    Hello, Kutoz. 
    Thank you for visiting Apple Support Communities. 
    Here is some information that you may find helpful with this issue. 
    I'm not receiving the verification code via SMS.
    Make sure that you have a strong cellular network connection on your phone.
    Make sure that your phone number can receive SMS messages. You can do this by asking someone to send you a text message.
    Make sure that the correct phone number is associated with your account:
    iOS 7.0.3 or later: Tap Settings > iCloud > Account, then tap Keychain. Make sure the phone number under Verification Number is correct. If not, enter another phone number.
    OS X Mavericks v10.9 or later: Choose Apple () > System Preferences. Click iCloud, then click Account Details. Make sure the phone number listed under Verification number is correct. If not, enter another phone number.
    If you can't access a device that has iCloud Keychain enabled, you can contact Apple Support and verify your identity to get help completing iCloud Keychain setup.
    Get help using iCloud Keychain
    http://support.apple.com/kb/TS4644
    Cheers,
    Jason H. 

  • "This message cannot be sent at this time."  I have been getting this pop-up for 3 days when trying to send out mail.  I don't know what to do!  I cannot send mail from this account on any ISP. Please help!

    "This message cannot be sent at this time."  I have been getting this pop-up for 3 days when trying to send out mail.  I don't know what to do!  I cannot send mail from this account on any ISP. Please help!

    lots of people seem to be havgin a problem sending email from iCloud webmail.
    does your email address have uppercase characters in it?
    if so, try creating an alias in lowercase (go to preferences in iCloud webmail and select 'accounts') and see if email sends okay from that

  • How do you get your ipod touch to make a noise when people text you and to pop up on the screen my friend did something to her ipod to do this but i dont know how please help!!!!!!!!!!!!!!!!!!!!!!!!!!! its like she updated it but i already tried it!!!!!!

    how do you get your ipod touch to make a noise when people text you and to pop up on the screen my friend did something to her ipod to do this but i dont know how please help!!!!!!!!!!!!!!!!!!!!!!!!!!! its like she updated it but i already tried it!!!!!!i am very confused and want my ipod touch 4g like that please help thxns:)

    Go to Settings>Notifications and turn alerts/sounds on for the app(s) in question.  Not all apps have all options.

  • Hello, i have a problem with this number code  213:19,  please help me!

    Hello, i have a problem with this number code  213:19,  please help me!

    dan
    What version of Premiere Elements and on what computer operating system is it running?
    If you are using Premiere Elements 13, have you updated it to 13.1 yet? If not, please do so using an opened project's Help Menu/Updates.
    What type of user account are you using....local administrator or domain type?
    Please review the following Adobe document on the 213.19 issue. Have you read that already?
    Error 213:19 | Problem has occurred with the licensing of this product
    ATR

  • TS2755 I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    I recently upgraded my IPhone and for 1 person I began receiving this "7233375 Error Invalid Number. Please re-send using a valid 10 digit mobile number or valid short code". I receive text from this person but cannot send. Please help. Thank you.

    Hi there
    I’d be happy to help with this messaging error! This will be due to the device storing the number incorrectly. Please do the following to resolve the issue:
    Delete texts from both old number and new
    Delete any call logs including these numbers
    Delete old number from contacts
    Delete new number from contacts
    Restart device
    Send text to the new number directly (do not save as contact)
    Once the text sends successfully, you can then save as a new contact
    I hope this helps!
    Charise

  • I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    This can be the result of selecting the wrong driver. An older, unsupported laser printer will sometimes work with the generic Postscript driver.

  • I started the OS system from a backup hard drive. Now My Adobe products doesnt work. "the licensing does not work for this product" Error code 150:30. Help me please!!

    I started the OS system from a backup hard drive. Now My Adobe products doesnt work. "the licensing does not work for this product" Error code 150:30. Help me please!!

    Reinstall the software properly. migration/ backups do not work due to the specific requirements of the activation system.
    Mylenium

  • I would like to know how i stop some albums ive bought from transfering to my iphone i delete them from itunes but when i sync my phone they transfer from my iphone this is a pain some one please help!!

    I would like to know how i stop some albums ive bought from transfering to my iphone i delete them from itunes but when i sync my phone they transfer from my iphone this is a pain some one please help!!

    Burb79 wrote:
    I thought of that one two tried it but still no joy. I have an ipad2 as well which I set up to not sync any music to it but for some reason the albums have got onto that as well. im thinkin its somthing to do with the dam cloud thing
    Go to Settings/ Store and under the category "Automatic Downloads" you can turn OFF the automatic download of purchases to your device (this needs to be done for each device). There's also a setting in iTunes just for automatic pushes to your iTunes library.
    To remove a purchase you've made directly to your device, you can either:
    a- Swipe across the song title from left to right and press Delete, or
    b- If you auto-sync your device, connect to iTunes and click on the Music tab where you define your sync settings (the Music tab is to the right of the overall Summary page of your device). At the bottom of the Music tab you'll see direct purchases that are on your device -- simply un-check those and click "Apply" or "Sync" to remove them.
    c- If you manually manage music on your device, connect to iTunes and click the small arrow to the left of your device name, and then click on the Music folder under your device. Then navigate to the item(s) you want to remove and then delete them.
    To prevent things from syncing from your library to your device, there are many ways to do that (un-checking things in your library is one way, but not the best IMO). Might want to read the manual or some online tutorials on iTunes if you want to learn more.

  • My iPhone 4s refuses to play sound when the headphones are not in. When the headphones are in however, it works perfectly fine! This is most annoying, could someone please help me :)

    My iPhone 4s refuses to play sound when the headphones are not in. When the headphones are in however, it works perfectly fine! This is most annoying, could someone please help me   I have not dropped it and it has not been in any contact with liquid.

    I just tried both of those things and to no avail. Here are some pictures if that will help

  • WHEN-CUSTOM-ITEM-EVENT - not firing. Please Help

    Hi Grant,
    WHEN-CUSTOM-ITEM-EVENT - not firing. Please Help..
    I need a help from you.
    1) I have developed an form to browse the client machine and upload the file on server / table
    2) Registered the form in Oracle Apps 11.5.10.
    3) Currently i am able to open the File_Dialog and browse throught the clients machine
    But when ever user selects any file and says Open, i am not able to retrieve the file name. wHEN-CUSTOM-ITEM-EVENT is not
    firing. I am sure how we can invoke this CUSTOM-ITEM-EVENT.
    To devlop the form i have referred PERWSIMG.fmb - of Oracle (Apps) HRMS which uploads the employee photo in the Database.
    Hence i have used the same java code / Implementaion Class.
    Please help...
    Regards
    Sameer

    Hi Francois,
    You were right. I re-loaded the zip file and the original version works. Odd, as I don't remember ever modifying those files.
    But my original issue still remains.
    The only code I've added is this:
    Color mycolor = this.getBackground() ;
    setBackground(mycolor);to the CalendarFrame constructor. How could this be causing the trigger to not fire?
    Could it be the way I created the bean? I copied all the java files to my project, attached the libraries, created a deployment profile. Everything compiles without errors or warnings, and the jar is created without issues. The java console doesn't give any errors either.
    Thanks for all your help,
    A
    Edited by: Abigail Parmar on Mar 26, 2009 1:01 PM

  • I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 profession​al. The create new report VI opens Excel but throws error (-21471672​62- from automation open VI) when I try to open MS word. please help...

    I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 professional. The create new report VI opens Excel but throws error (-2147167262- from automation open VI) when I try to open MS word. please help...

    Hi Leo22,
    Does this error occur if you use any of the example programs that come shipped with LabVIEW? I would try opening one of the examples that write data to Word and see if those give you an error. Also, have you tried just putting down a New Report.VI and change the report type to Word? If this simple vi (that's all you need to open Word) breaks, I would check to see if there are any instances of Word still open. Check the task manager to see if any word processes are still open. There should not be a problem accessing Word 2003 from LabVIEW 7.0. If neither of these solutions work, please give some more detail about your application and we can research further. Thanks!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

Maybe you are looking for

  • Nvidia GeForce 8600M GT question

    Is anyone running Vista 32 bit using Bootcamp on their SR MBP with the Nvidia GeForce 8600M GT? I ran a vista compatibility scan on the MBP and it said that the card would not work in Vista. I am curious whether this is true or whether others with th

  • Infoprovider check in authorization

    hi guys, i am creating an auth object for hierarchy authorization however when i try to check it on the infoprovider i dont see the auth object (i did create a definition for the hierarchy and all) help me out, its urgernt thanks

  • Attaching a Transaction Code to Report Painter Report

    Hi All After creating a report painter report in GRR2 ... I tried to attach it to a transaction code in SE93... But am not able to do so? Is this possible and if so how is it done? Thank you Rukshana

  • VMWare size increase, Vertex/SAP implications

    Hello, We are upgrading our physical hardware to increase our disk size in our VMWare servers.  Vertex resides on this server we RFC for the tax.  Are there any jobs that I should make sure that are not running?  I have told everyone to be out of the

  • Save Query in WEBI

    Hi, I am working on BOXI R3.1. my user  have been trying to modify and save queries to our personal boxes on BO, however it comes up with an error saying that we do not have permission. Can u please suggest, which right i have to give in CMC Thanks