JButton event requires code to finish before updating JTable

Hi everyone,
I need some help with Java. I've been creating my first Java app and hit a wall where cannot find a solution on Google.
I have a JFrame with a button called "Start".  The code behind the "Start" button triggers a function (startwork() ) that traverses through log files and then inserts rows into my JTable.  If I call the startwork() function from the Start button action performed event, then when it inserts the rows to the JTable it is not immediately shown... the code has to finish before the JTable is refreshed.  However, if I run the startwork() function as soon as the JFrame is displayed (from the main() function) then I can see the Jtable being populated dynamically as it is inserting the rows.
Can someone explain how to allow the user to click on the START button and yet behave correctly to where the JTable is updated properly so that I can see the rows being inserted as it progresses. 
Thank you!

Thank you for the reply. However, I find it strange that I need to write a SwingWorker sub-class for every button in my GUI that wishes to do some meaningful work.  No other programming language that I have used does this. In Visual Basic, we simply add a function in the event handler and that is it.  It seems overkill to write a SwingWorker class to basically create another thread that runs some code. I don't see why my GUI has to completely freeze just because I run code in an event.

Similar Messages

  • I have an iMac running OX 10.5.8 I need a portable external harddrive to back it up before updating the software to Yosemite but I can't find anything that doesn't require you to be running at least OX 10.6.  Is there a suitable hard drive?

    I have an iMac running OX 10.5.8
    I need a portable external hard drive to back it up before updating the software to Yosemite but I can't find anything that doesn't require you to be running at least OX 10.6.  Is there a suitable hard drive?  I'm not very technical and wouldn't know how to do any formatting so I want it to be very basic so that I can just plug it in.  500GB should be more than adequate.

    Correct.  When you purchase devices, they would have stated the OS they needed to work, on the box.  This can be overlooked, but it is very important to check when purchasing. 
    You current OS, is so old, that they technology build into the new devices, is not something your OS understands.  It didn't exist when your OS was created, and therefore you need to upgrade the OS to work with the newer technology of these devices.
    10.6 software is not downloadable.  You must purchase a DVD disc.  You can order it from the on-line apple store
    - http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard.

  • HT201210 Before updating ios on my ipad I didn't have a passcode. It now wants me to log in a code. I tried one I used previously, then 0000 but am now locked out and my ipad is disabled!

    Before updating ios on my ipad I didn't have a passcode. It now wants me to log in a code. I tried one I used previously, then 0000 but am now locked out and my ipad is disabled!

    Forgot password or device disabled
    http://support.apple.com/kb/ht1212

  • Bios update failed : does not meet system requirements code 9994/9996

    bios update failed : does not meet system requirements code 9994/9996 / Model ny801av-aba HP Pavilion p6100z cto Desktop  windows vista basic  current bios version 5.38, released 03/20/09. 4GB ram (3.5 useable) AMD semperon LE- 1300 socket am2+  code name sparta.  M2N68-LA Motherboard BIOS update verision 5.49 released 08/24/09      (am trying to upgrade to a AMD phenom triple core 8400 2.1 gig that is why I am trying to update the bios, when I put it in I got nothing.)
    This question was solved.
    View Solution.

    Figure 1: Error message
    The error displays when ...
    the update requires certain hardware or software that is not installed on your computer (examples: keyboard replaced with a non-HP keyboard or Microsoft .NET software is not installed),
    the computer does not meet a certain minimum hardware or software requirement (examples: 4 GB minimum memory, 200 MB free disk space, or .NET version 2.0 required and 1.0 is installed) .
    Usually, this error indicates the update is not needed for your computer and it should not be installed.

  • Error Code 8024200D while installing update KB3000850 for Windows 8.1

    Error Code 8024200D while installing update KB3000850 for Windows 8.1
    I have been prompted for the last 10 days to install the important update KB3000850 in my laptop, but the installation fails every time.
    Two days ago, on March the 12<sup>th</sup>, I installed 31 updates without any problem. What is wrong with this particular update?
    You will find below my dialogue with Microsoft Support Engineer, Mr Niranjan Manjhi, who referred me to you:
    Hi Michelle,
    Thank you for posting your query in Microsoft Community.
    I understand that you are unable to install the a specific update KB3000850. I will be happy to assist you with your query. Let me ask you;
    Is your computer connected to domain?
    Which security software is installed in the      computer?
    Do you remember making any specific change in the      computer prior to the issue?
    This November update rollup also includes all previous updates since the previous image update in April 2014 and this includes performance and reliability
    improvements.
    Cause:
    This issue occurs because a process keeps a file in the component store open. Therefore, the file cannot be deleted or overwritten. Let's try the methods below and
    check the status.
    Method 1: Depending on the architecture of your
    Windows 8.1 operating system, I would suggest you to install the following package first and then try installing the KB3000850.
    All supported x86-based versions of Windows 8.1: [link] Download the package now.
    All supported x64-based versions of Windows 8.1:
    [link] Download the package now. 
    Restart is required.
    Method 2:
    If the issue still persists, run the Windows Update Troubleshooter and check the status.
    Click to run
    [link] Windows Update Troubleshooter
    Also refer to:
    [link] Troubleshoot problems with installing updates
    Hope this information is helpful. Please feel free to reply in case you face any other issues with Windows in future.
    Regards,
    Niranjan Manjhi
    Dear Niranjan,
    Thank you for your answer.
    To answer your questions:
    1) Yes, my laptop is connected to the domain,
    2) My security software is McAfee Total Protection, the same I use for my PC running Windows 7 XP,
    3) I did not make any specific change to the laptop. It is true though that I run regularly McAfee´s QuickClean.
    In your answer, you suggested 2 methods for resolving the problem.
    I chose to apply first the second one, i.e. I ran once again the Windows Update Troubleshooter, which revealed again the following status:
    Potential Windows Update Database error detected Ox800F08F: Not fixed
    Windows Update components must be repaired: Fixed
    And a last information: Yesterday, McAfee´s Vulnerability Scanner was automatically activated, showing as "critical" the update in question ("important" according to Windows)!
    As for applying the first method you suggested, I will need the services of a professional, someone more IT literate than myself.
    Michelle
    Hi Michelle,
    Thank you for keeping us updated on the issue.
    Since the computer is connected to domain, I would request you to post your query in the TechNet forums as your question is beyond the scope of what
    is typically answered in this consumer forum and would be better suited for the IT Pro audience on TechNet.
    Please post your question in the link TechNet Forums.
    Regards,
    Niranjan Manjhi

    Hi there @Achintya-only
    Welcome to the HP Support Forums! It is a great place to find the help you need, both from other users, HP experts and other support personnel.
    I see that you are getting an error code, when you try to install Windows 8.1 from USB or DVD. I am happy to assist.
    Just to clarify, you are using a standalone Windows installation disk, you are not using a factory recovery image. Is that correct?
    Have you run the hardware diagnostics on your notebook? HP Notebook PCs - Testing for Hardware Failures (Windows 8)
    What operating system was on the system before, and have you made a set of recovery media, for your original factory installation?
    Please let me know what you find.
    Malygris1
    I work on behalf of HP
    Please click Accept as Solution if you feel my post solved your issue, it will help others find the solution.
    Click Kudos Thumbs Up on the right to say “Thanks” for helping!

  • Finding codes on screen before booting up.

    Hi guys, first time posting here because I seem to be running into an issue. Whenever I turn on my PC, I find that my pc shows a black screen with the codes 9c, 99, and a2. These codes happen to stay for a couple of seconds but I have never seen these codes until recently. My system is composed of:
    MSI z97 Pc Mate
    ADATA DDR3-1600 4GBX4 Ram
    Gigabyte GTX 980 G1 Gaming
    An Intel 530 SSD 240GB
    Seagate 2tb Barracuda HDD
    Corsair H50 CPU cooler
    Peripherals composed of:
    Corsair K70 RGB
    Razer Deathadder
    and 2 ASUS 279H monitors.
    Thank you guys for your help!

    Quote from: Nichrome on 19-October-14, 18:53:22
    Did you update anything related to BIOS (BIOS/Intel ME) recently? Or did Live Update do it?
    Any OC on the CPU?
    Or did you add anything new like different keyboard, or some USB hub? Try disconnecting every USB device, leave only keyboard and mouse plugged in and see if something shows up.
    Codes are nothing bad really, helps diagnose issue if there is one. What I understand by A2, is that it will always show up when POST is finished without errors. At least that's the last code I see before Windows boots up.
    99   Setup timer data area/printer base address
    9C   NPU initialization
    A2   Display and soft errors
    I have updated via Live update to Bios v. 4.5.
    I do not overlock my system at all if that helps.
    It just concerns me that I happen to see all these other codes too, including "9c" when I turn off/restart my computer. This all occurred after my SSD failed but since then I replaced the SSD and reinstalled Windows but this continues to occur. Before any of this, everything was fine.

  • Raise event by code

    Hi
    I wonder if it is possible to raise an event via code without using
    wdControllerApi.getMessageManager().raise or report.....
    Thank you
    yuval peery

    Hi Jeschael
    1. I do not have a drop down list but a search help attached to input field. This input field lies inside
        a table column.
    2. I do not have a onChange event since this event, so I understand from Albrecht, was introduced in 7.1
        whereas we still use 7.0.
    3. What I did was create a dummy label which is linked to a calculated attribute.
    4. The calculated method always returns an empty string, but on the way it also updates the
         fields I am interested in. The problem was that although I updated the context attribute I was interested in, the UI element did not update. To solve this problem I added the following line just before the method returns an empty string:
    wdControllerApi.getMessageManager().reportSucccess("bla bla bla", false);
    This did the trick.
    I hope it helps.
    Yuval

  • Making this change would require code that is locked by a template or a translator. The change will be discarded.

    I apologize if this has been answered before, but I can't
    seem to find a solution in the forum archive. The error message
    below displays in Dreamweaver CS3 when I attempt to edit a
    Fireworks CS3 file using the "Edit" button in Dreamweaver. After
    clicking "Done" in Firworks to update the file and return to my
    HTML page in Dreamweaver, the error message displays. Can someone
    help me troubleshoot the problem? As a side note, I tested it in my
    older version of Dreamweaver and Fireworks (studio 8 versions) to
    see if I would get the same error message and I didn't - everything
    worked fine and no error message displayed.
    DW Error Message: Making this change would require code that
    is locked by a template or a translator. The change will be
    discarded.
    Thanks for your help,
    Donna

    > Murray, what do you mean? My pages validated before the
    switch to DW8.
    Are you sure? Show us one.
    The error you describe is only thrown in one of two cases -
    1. You have actually changed what is being mentioned (sadly
    this is most
    often NOT the case)
    2. You have a coding error somewhere on the page (or in the
    CSS) that is
    causing the template engine to burp this error message even
    though it
    doesn't really apply
    DW4 was nearly totally unaware of 'validation' errors. DW8 is
    MUCH stricter
    about them. When anyone says "this was fine in DW4 and is now
    not fine in
    DW8" this is the first and most likely solution.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Inge Grotjahn" <[email protected]> wrote in message
    news:[email protected]..
    > Am 13.09.2007 schrieb Murray *ACE*:
    >
    >> DW4 was much more tolerant of errors in your code
    than DW8 is. Your
    >> symptoms are an absolute diagnostic for such errors.
    >
    > Murray, what do you mean? My pages validated before the
    switch to DW8.
    > I only imported my site from DW4 and used the existing
    templates.
    > After changes of the template I used DW's feature to
    update all
    > relevant pages automatically. Then I wondered, why I
    couldn't make
    > changes on the child-pages within the editable regions.
    Finally I
    > created the template page new in DW8 and applied the new
    template to
    > all my pages. Now it is working fine, although my pages
    still state,
    > that they relate to a DW6 template, which I never had?
    >
    > Best regards:-)
    > Inge Grotjahn, puzzled:-)
    > --
    > CatManiacs World:
    http://www.gwsystems.com/inge

  • Halting the update from a BEFORE UPDATE trigger

    Hello,
    I'm writing a trigger which is set to fire before update. One of the possible scenarios requires that the row being updated is not updated but instead deleted. Is it possible to send a DELETE query and then stop the update process so it doesn't spit out an error? I haven't tested this yet, but I'm quite sure it will give an error if it's trying to update a row which has just been deleted.
    Thanks,
    Pavel

    Hi,
    Personally, I don't like implement some business logic into trigger... so, why run an update whenever you need a delete ?
    I would modify the original code to delete in this case instead of update.
    My 2 cents,
    Nicolas.
    SQL> create table pavel (id number, txt varchar2(10));
    Table created.
    SQL> insert into pavel values (1, 'This one');
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace trigger pavel_trg
      2  before update on pavel
      3  for each row
      4  begin
      5  delete from pavel where id = :old.id;
      6* end;
    SQL> /
    Trigger created.
    SQL> update pavel set txt = 'Two';
    update pavel set txt = 'Two'
    ERROR at line 1:
    ORA-04091: table SCOTT.PAVEL is mutating, trigger/function may not see it
    ORA-06512: at "SCOTT.PAVEL_TRG", line 2
    ORA-04088: error during execution of trigger 'SCOTT.PAVEL_TRG'Message was edited by:
    N. Gasparotto

  • A few things that might help before updating to 4.0 (if you haven't yet):

    I'm in the IT dept of the company I work for and it's my job to troubleshoot, test, implement etc etc everything and anything regarding iphones and other related software. So, after MUCH trial and error, here are some of the key points I have found regarding the upgrade that I hope will also help other people as they have myself and others whom I work with. So here are some snippets of the mass email I sent out to our other associates who have yet to upgrade their OSs:
    In order to make sure that you're upgrade goes as smooth as possible: please take into consideration the following recommendations:
    1. It is not necessary to do the software upgrade on the same machine that you normally use to sync your phone.
    I sync my phone at home on a PC, but upgraded the software at work on a Mac. I lost no data/music/photos/contacts/applications and it was fast and easy. I highly, highly, HIGHLY recommend you do your firmware upgrading on a Mac. I also did it at home on the pc and it was a nightmare. I had to uninstall and reinstall every scrap of Apple software I ever had on there and all kinds of other permissions/backup problems ensued.
    Do yourself a favor and DO NOT upgrade your iphone's OS on a PC.
    If you do not have a Mac, chances are you know somebody who does who will let your borrow their iTunes for an hour.
    2. Obviously, you will need the most recent version of iTunes (9.2) and OSX10.5 or later on your computer (OPTIMALLY, you will have 10.6.4). Again, do this on a Mac. If it is not, please download and install 10.6.4/9.2 (DO NOT have your phone plugged into the machine while you do this). Wait for everything to upgrade, then restart your computer.
    3. Always, always, always make sure you have a reliable backup of your phone's contents SOMEWHERE (it doesn't necessarily need to be on the computer you use to sync it, and to be honest I would recommend NOT using that same machine for the firmware upgrade). In the off-chance that your upgrade fails, you will lose all of your data if you do not have a backup.
    4. Once all of your machine's software has been updated, go ahead and open iTunes THEN plug your phone into your machine. Once it finds your phone, it will likely automatically prompt you to upgrade your phone's firmware and carrier settings. Accept this.
    If it does not, please choose the "check for update" button on the summary screen of your selected iphone in itunes.
    Downloading and installing should take roughly 20-45 minutes (depending on your speed/connection). Itunes will create a backup of your current data/settings before installing this which shouldn't take more than 15 minutes and will overwrite your previous one.
    You should not encounter a need to sync ANYTHING at this point, so please please please do not sync before updating. Keep it plugged in and do not answer any incoming calls, texts or emails while this is occurring. In fact do NOT use your phone at all, in any way while the update is being downloaded or applied.
    5. If all goes well, your phone will restart itself after the installation. This will take a few minutes. It will disappear from your itunes during this time, but fret not, it will return. When it does, and you are told by itunes that the upgrade is complete, it is now safe to disconnect your phone and try out all the new features. (A reboot is HIGHLY recommended)
    All of the listed features of the new iOS4 will be fully operational on all 3GS phones. 3G phones will not be able to multitask, among a few other things but nothing about its basic functionality will be removed. This update is not available for 2g phones at all. Once updated, it cannot be retrofitted with the old firmware without hacking and if you hack your phone, I will not support it and neither will Apple. Also, the FaceTime video chatting function is only supported on the iPhone 4.
    For a comprehensive list of all of the cool new things you can now do with your upgraded phone, I recommend you READ the following links:
    Really basic:
    http://www.apple.com/iphone/softwareupdate/
    http://www.apple.com/iphone/ios4/
    Basic:
    http://gizmodo.com/5568954/the-complete-guide-to-using-ios-4
    Intermediate:
    http://www.tipb.com/2010/06/14/ios-4-walkthrough/
    Hope this helps some folks and sheds some light on some of the things that can go wrong with your update and how you can avoid them!
    Message was edited by: jinniferb

    Hi - my IT department directed me to this page as we have been experiencing a few sync issues etc. So I downloaded the patch - my email account will not sync properly now. Is there any way I can uninstall this patch?
    iOS 4: Exchange Mail, Contacts, or Calendars may not sync after update
    Last Modified: 28 June, 2010
    Article: TS3398
    Symptoms
    Immediately after updating to iOS 4, some users may notice that Exchange ActiveSync Mail, Contacts, or Calendars do not sync, or sync very slowly. In addition, some Exchange Server administrators may notice their servers running slowly.
    Products Affected
    iPod touch, iPhone 3G, iPhone 4, iPhone 3GS
    Resolution
    To work around this issue, users should install a configuration profile from Apple that increases the amount of time the iOS 4 device will wait for the Exchange Server to respond to its sync requests. For best results, the profile should be installed on as many iOS 4 devices at your company as possible.
    To install the profile:
    Use Safari on your iOS 4 device to download the configuration profile. It may be easiest to read this article with your iPhone or iPod touch and tap the download link there, but you may also email the attachment to another email account on your iOS 4 device, and tap the attachment to open it.
    Tap Install to install the profile, and enter your passcode if prompted.
    A warning message will appear because the profile is not signed. Tap Install Now.
    Tap Done to complete the installation, then power off your device and power it back on.
    Wait for your Exchange data to finish syncing.
    After installation, the profile will be listed under Settings > General > Profile.

  • I have a Lion content code for the free update. Is there a time limit on how long I have to download it

    I received a web order number and content code for my free update of Lion. Is there a time limit on how long I have before I must actually download the application? Thanks. JVC

    There is a time limit.
    http://www.apple.com/macosx/uptodate/

  • Do I need external hard drive to back up my iMac before update to mountain lion? My is OS 10.6.8

    Do I need external hard drive to back up my iMac before update to mountain lion? My is OS 10.6.8.

    First, repair your hard drive and permissions:
    Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    Second, make a bootable backup to an external drive using the Restore option of Disk Utility:
    Clone using Restore Option of Disk Utility
      1. Open Disk Utility in the Utilities folder.
      2. Select the destination volume from the left side list.
      3. Click on the Restore tab in the DU main window.
      4. Select the destination volume from the left side list and drag
           it to the Destination entry field.
      5. Select the source volume from the left side list and drag it to
          the Source entry field.
      6. Double-check you got it right, then click on the Restore button.
    Destination means the external backup drive. Source means the internal startup drive.
    Third, purchase and download Mountain Lion from the App Store. Be sure you meet the requirements for Mountain Lion:
    Upgrading to Mountain Lion
    To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase and download Mountain Lion from the App Store. Sign in using your Apple ID. Mountain Lion is $19.99 plus tax. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
         OS X Mountain Lion - System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
             7. Xserve (Early 2009) - Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
         Are my applications compatible?
             See App Compatibility Table - RoaringApps.
         For a complete How-To introduction from Apple see Upgrade to OS X Mountain Lion.

  • Before Update Trigger has mutating problem

    I'm getting a mutating problem with this updating trigger. I'm not sure how to deal with it. Here is my code:
    CREATE OR REPLACE TRIGGER WTL_SMP_TRG2
    BEFORE UPDATE ON WTL_SAMPLES
    FOR EACH ROW
    DECLARE
         sampleCount NUMBER(1) := 0;
         dupLabSampleID NUMBER(8) := 0;
    BEGIN
         SELECT COUNT(sample_ID)
         INTO sampleCount
         FROM wtl_samples
    WHERE jb_job_id = :new.jb_job_id
    AND lab_no = :new.lab_no
         AND sample_ID != :old.sample_ID;
         IF sampleCount > 0 THEN
         SELECT sample_ID
         INTO dupLabSampleID
         FROM wtl_samples
         WHERE jb_job_id = :new.jb_job_id
         AND lab_no = :new.lab_no
              AND sample_ID != :old.sample_ID;
    RAISE_APPLICATION_ERROR(-20501, 'Update failed, Lab Number ' || :new.lab_no || ' is used by SampleID: ' || dupLabSampleID);
    END IF;
    --EXCEPTION
    --     WHEN OTHERS THEN
    -- RAISE_APPLICATION_ERROR(-20901, 'Error in WTL_SMP_TRG2.');
    END WTL_SMP_TRG2;
    any help appreciated
    adam

    I guess I couldve done that, but was using design editor and didn't know how to put a unique constraint in. Is the problem only because I'm referencing the :old.sample_ID, or the :new values as well? If it's just the :old value I could write a before update statement trigger to place the sample_id into a package varaible and then call that variable up in the row level trigger.... i've tried this, but don't know how to pull the sample_id value i need in the before statement trigger... i'll supply the code i've done so far...
    CREATE OR REPLACE TRIGGER WTL_SMP_TRG2_INIT
    BEFORE UPDATE ON WTL_SAMPLES
    DECLARE
    BEGIN
         wtl_trg_custom_pkg.oldSampleID := sample_id; /* Doesn't know sample_id...? */
    END WTL_SMP_TRG2_INIT;

  • How to count the number of Rows to be Updated before Update takes place..

    Hi all,
    I have a requirement, where i have to count the number of rows to be updated before updating it. SQL%ROWCOUNT gives the no. of rows updated ( after update takes place). How do i get to know the count of no. of rows to be updated/inserted/ deleted. I was looking for a simple solution, as above SQL%Rowcount. But i couldn't find any. I can use a Function and Return the value which will give me number of rows to be updated, But is there any Simple Logic other than this.. or any count function. Your Help is Appreciated. Thanks!

    If you really want to do this (I have no clue why you would need it), then you can piggy back on any existing pessimistic locking you may already have in place.
    However, it would require two loops through the records of which you want to know the count before you update, and a second pass to update them.
    I would really re-think the need for this, though.
    SQL> create table t0304(c number);
    Table created.
    SQL> insert into t0304 select rownum from all_objects where rownum <= 10;
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    SQL> declare
      2    cursor mycursor is select * from t0304 where mod(c,2) = 0 for update;
      3    i number := 0;
      4  begin
      5    for r in mycursor loop
      6      i := i + 1;
      7    end loop;
      8    dbms_output.put_line(i);
      9    for r in mycursor loop
    10      update t0304 set c = c + 20 where current of mycursor;
    11    end loop;
    12  end;
    13  /
    5
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
            22
             3
            24
             5
            26
             7
            28
             9
            30
    10 rows selected.
    SQL>Edited by: Steve Howard on Mar 4, 2011 5:57 PM

  • Before Update Trigger compilation problem

    Hello experts! I have a compilation problem for a trigger I am trying to create.
    As a matter of fact it should update INT_INITIAL with the old value of INT_LOCK.
    The compilation fails and the debugger raises an ORA 01747 error (invalid declaration for user table, user column etc.)
    Do you have an idea what is wrong with my code?
    create or replace
    TRIGGER TRIGGER_INT_INITIAL
    BEFORE UPDATE ON  TBL_MATRIX_INTERMEDIATE_RESULT
    FOR EACH ROW
    Begin
      IF NVL(:new.INT_INITIAL, 0) != :old.INT_LOCK THEN
           UPDATE TBL_MATRIX_INTERMEDIATE_RESULT set
          :NEW.INT_INITIAL = :old.INT_LOCK;
      END IF;
    END;Regards,
    Seb

    Hi Seb,
    You don't need to use UPDATE stmt here as you are updating the same table on which your trigger is fired. So it may cause mutating table error too.
    when you use :new.colname it will immediately take care of the new value to be inserted in the respective column.
    So no need to write Update stmt.
    Hence remove,
    UPDATE TBL_MATRIX_INTERMEDIATE_RESULT set And use := is an assignment operator whereas = is to equate..
    :=Twinkle

Maybe you are looking for