How do I know if my update didn't work because the record doesn't exist

I am updating a row in a table and I want to know if the update didn't work because the record doesn't exist. Is there any way of knowing this? I want to avoid doing a select first if at all possible. I am using sqlj with Oracle 9i on Linux and JDK 1.3.1.

I got it. So if anybody else needs to know this here it is.
import sqlj.runtime.ExecutionContext;
ExecutionContext ec = new ExecutionContext();
#sql [ec] {update statement};
if (ec.getUpdateCount() == 0){
throw new SQLException("No rows for update");

Similar Messages

  • How do I know if an update failed because the record doesn't exist

    I am updating a row in a table and I want to know if the update didn't work because the record doesn't exist. Is there any way of knowing this? I want to avoid doing a select if at all possible. I am using sqlj with Oracle 9i on Linux and JDK 1.3.1.

    ...and I want to know if the update didn't work because the record doesn't exist. It is possible that you are looking at the problem wrong. An update doesn't 'fail' if there is nothing to update. So it works whether anything was updated or not. And so it might simply not be possible to see whether zero or more rows were updated. (Returning how many rows were updated might represent an enhancement rather than a necessity.)
    I didn't find anything specifically that said this was or wasn't supported by briefly looking at the Oracle docs and searching google.
    If nothing else you could always do a select first with the same where clause and then do the update if the select returns a non-empty set.

  • HT1923 When I try to uninstall iTunes I get a message saying iTunes 64 msi can not be located and I should enter an alternate path. How would I know where it it is? I get the same message when trying to install the update to iTunes 10.6.1.

    When I try to uninstall iTunes I get a message saying iTunes 64 msi can not be located and I should enter an alternate path. How would I know where it it is? I get the same message when trying to install the update to iTunes 10.6.1.

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • HT1338 How do I know it is updating? I don't see the icon and want to get rid of this tool bar someone put on my desktop

    How Do I know it is updating? I clicked the "19.99" and I was signed in, but it never made me agree to anything, it just says updating.  I don't see any progress bar or anything.

    Look on the Launchpad icon in your Dock. Or switch over to the Purchases side in App Store. If it's downloading it will take a while since Mountain Lion is over 4 GBs.

  • How do I know iCloud is updating my device?

    I am now connected to iCloud on my iPhone 4 & iPad II
    How do I know it's updating everything? Is there a test?

    Tap Settings > iCloud > Storage & Backup
    See: Last Backup just under Back up Now
    You'll see the date.

  • How can i know which index will be used when executing the query ?

    1 ) I have query in which i have 3-4 tables but there multiple index on one column .
    so how can i know which index will be used when executing the query ?
    2) I have a query which ia taking too much time . how can i know which table is taking too much time ?
    3) Please Provide me some document of EXplain plan ?

    Hi Jimmy,
    Consider the below example
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    CREATE TABLE FIRST AS
    SELECT * FROM all_objects;
    UPDATE FIRST
    SET object_name = 'TEST'
    WHERE owner != 'SCOTT';
    CREATE INDEX idx_first ON FIRST(object_name);
    SELECT *
    FROM FIRST
    WHERE object_name = 'TEST';
    It has not used index
    Execution Plan
    Plan hash value: 2265626682
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 58678 | 7334K| 163 (4)| 00:00:02 |
    |* 1 | TABLE ACCESS FULL| FIRST | 58678 | 7334K| 163 (4)| 00:00:02 |
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    SELECT *
    FROM FIRST
    WHERE object_name = 'emp';
    This has used the index
    Execution Plan
    Plan hash value: 1184810458
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 128 | 1 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| FIRST | 1 | 128 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | IDX_FIRST | 1 | | 1 (0)| 00:00:01 |
    From this we can come to the conclusion that, whether to use one index or not by oracle
    would also depend on the data which is present in the table. This has to be this way as
    we see in the bind peeking, if oracle sticks to only one plan, say only use the full table
    scan, it would be a performance hit when it searches for the second query ie where object_name
    ='emp';
    2.
    If we have a query like below.
    select * from emp
    where upper(ename) = upper(:p_ename);
    Evenif we have the index on ename column, oracle wouldn't be able to use the index, as there is a function in the predicate column. If you need oracle to use the index, we need to create a function based index as below.
    Create index idx_ename on emp(upper(ename));
    Regards,
    Cool

  • I recently changed my internet service provider and my e mail address. I updated my iTunes account with the new e mail. Now I cannot get updates on my devices, because the login box on each still contains my old e mail. How can I change this please?

    I recently changed my internet service provider and my e mail address. I updated my iTunes account with the new e mail. Now I cannot get updates on my devices, because the login box on each device still contains my old e mail, and I do not know how to change this How can I change this please?

    Try tapping on the id in Settings > iTunes & App Stores on your devices (Settings > Store if they aren't on iOS 6+) and then log back in and see if that 'refreshes' the account on them.

  • How do I reset my software updates to default back to the apple updates ser

    How do I reset my software updates to default back to the apple updates server. I used ARD to send a unix command to download the software from my test server but now I don't know the exact path to point it back to the apple updates server. Below is the command line I sent via ARD. I appreciate any help.
    defaults write com.apple.SoftwareUpdate CatalogURL http://mobileserver.virtualco.com:8088/index.sucatalog

    Niel, I appreciated the help and quick response. A friend did email me that exact command line and it work. john

  • How would I know if any one post a thread in the Forum

    Hi All,
    Please tell me how would I know if any body post a thread in the  forum??
    Regards
    krishhna

    Hi,
    I just read the "Suggestions and comments" forum and I found out that you did create a thread called "How would I know if any one post a thread in the Forum ".... So I knew that some one had posted a thread in the forum...
    Regards,
    Oliivier

  • Hello. My Muse update didn't work. I did the update via Cloud, but Muse is still asking me to update. And now?

    Hello. My Muse update didn't work. I did the update via Cloud, but Muse is still asking me to update. And now?

    You can follow the steps on this page:
    CC desktop lists applications as "Up to Date" when not installed

  • How about a "Show Incompatible App Updates" option same as in the Mac App Store?

    How about a “Show Incompatible App Updates” option same as in the Mac App Store?
    I want un-installable app updates from being displayed in Updates.  These updates require iOS 6.0 or later and cannot be installed on my original iPad that still runs 5.1.1 and cannot use 6.0.

    We are not employees or representatives of Apple. We are just users like yourself. Your idea does seem interesting though. Send feed back to Apple here
    http://www.apple.com/feedback/ipad.html

  • Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Itunes doesn't list all of my recent podcasts. My show is Black Tribbles and it only shows episodes through March 2013, however we do at least two shows a week and they aren't listed. The feed works because the show update to my computer. Help please.

    Your feed is at http://blacktribbles.podomatic.com/rss2.xml
    When subscribed to in iTunes the recent episodes show, but the Store hasn't updated for some time.
    There appears to be an issue with the feed. In the episode 'WRESTLING MARCH MADNESS: Final Bracket & Championship' of 31st March you will find in the 'description' tag the following line:
    4. KURT ANGLE
    At the end of this line is an invisible character which seems to be wrecking the feed - although it works OK when suscribing in iTunes it won't load in a browser (and I also found the feed very slow to load, which won't help matters with the Store)
    This sort of thing usually happens when you paste text in from a word processing application and manage to include one of the invisible control characters. I don't know how easy it will be do do it in Podomatic but you should delete that entire line and retype it to remove this charter.
    You should keep an eye on the time it takes the feed to be accessed - if there is a long enough delay (and it was quite some seconds when I tried) the Store may well timeout and fail to read it. At the moment it's showing a cached version from the last time it was able to read it.

  • How I can go back to former version of firefox, because the new one is unacceptable bad.

    How I can go back to former version of firefox, because the new one is unacceptable bad.
    I am just a computer and internet user, if you can't imagine what that's means, then I need to use and promote other web browsers.
    I am really mad about the update, who is worthless!
    sorry !
    think about your reputation and do fast better.
    sorry for my poor English
    greetings Dirk ( Scorpio.Irondragon)

    Try to drag the current Firefox application to the trash if you can't replace it.

  • My new iMac has recently had OSX Lion installed on it and now when I start the machine it looks like its updating something every time, and the wireless doesn't work. So I restart and everything is OK - until I have to start up again the next time?

    My new iMac has recently had OSX Lion installed on it and now when I start the machine it looks like its updating something every time, and the wireless doesn't work. So I restart and everything is OK - until I have to start up again the next time - then I have to repeat this again! Any help appreciated.

    I've been having the same issue, but have just discovered something on my own that hasn't been pointed out in any of the forums I've visited.  In what I thought would be a vain attempt to help myself, I went to System Preferences, Users & Groups, and then clicked on Login Items.  I discovered that one of the Items that was listed to open automatically upon login was iTunes Helper and that there was an exclamation point beside it indicating that it was incompatible.  I simply deleted that item and now I don't have the situation you described and my wireless is connected.  Hope this helps!

  • The report generation toolkit didn't work after the vi was build to an application.exe

    I write a VI using LabVIEW Report Generation Toolkit , it really works in the LabVIEW7.1 and 6.0 enviroment. but after the VI was build in to an application.exe, the LabVIEW Report Generation Toolkit didn't work even the application runs.
    thanks for your help.

    You might want to follow the procedure here:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/86256a47004e16d186256a84004cb883?OpenDocument
    (If the URL doesn't work, you can search for NI document ID: 2B87TVI8)
    Dan

Maybe you are looking for

  • Stream SD version of HD purchases on iPad/iPod

    My family owns an iPod Touch 5, iPad Mini, and an iPad 3.  We have a 12GB/month data-only wifi hotspot plan with Sprint.  My two daughters are often watching videos on the iDevices while we're on longer car trips or out running errands and such.  My

  • My Nano no long is syncing....how do I get the music from my Nano to my computer?

    I have an older IPod Nano but it does not synch anymore when I connect it to my laptop.  Do I have to buy another Nano?  If so, how do I get the music from my older Nano onto my laptop? Thanks

  • What is the little blue bell icon and HOW do I get rid of it?

    Hi all, I keep getting a little blue bell icon with 2 red curved lines up at the top right corner of my screen. I do not have any alarms or alerts set. What is this and how do I get rid of it? (permanently would be nice). Thanks in advance for any wi

  • Nokia N8 camera settings is not saved

    Hey. I found out that all the camera settings is not saved. For exampel i always want the grid displayed but then i have to turn it on manuelly every time. Same goes for the timer, id like it to be on 2sec so the picture not is taken as you push the

  • Resetting ACL - taking rediculously long time

    Hi I am trying to use the reset home folder ACL using the recovery utility (via terminal command "resetpassword") Two problems 1) It is taking an insane amount of time. I started yesterday morning. It is now 7pm the following day. 2) My laptop keeps