Can't update while select is active in read-committed mode

Hi
This is my business logic:
I m selecting the values from three tables by UNION ALL and i m geting the record set in while loop at the same time i try to insert the values which is getting from select statement in the First Table in the same while loop.
my problem is when i try to insert into the same table the following error is occured
"can't update while select is active in read-committed mode"
Now what can i do ? please give me ur solution ...
Thankx
Merlina

depending on how many values you have, you could store the results in memory, a vector or similar collection.
Then close the select statement, and insert the values from your vector into the table.... should work then.
Or, there may be a way of creating an updatable resultset ?
This question is better directed at the
"Java Database Connectivity (JDBC) & Transactions (JTA/JTS)" section of the forum. Maybe post a questions there, ensuring you give the URL of this question here too to avoid cross-posting.
regards,
Owen

Similar Messages

  • Can't update while select is active in read-committed mode- Pls Help Me

    Hi
    This is my business logic:
    I m selecting the values from three tables by UNION ALL and i m geting the record set in while loop at the same time i try to insert the values which is getting from select statement in the First Table in the same while loop.
    my problem is when i try to insert into the same table the following error is occured
    Thanks
    Merlina

    depending on how many values you have, you could store the results in memory, a vector or similar collection.
    Then close the select statement, and insert the values from your vector into the table.... should work then.
    Or, there may be a way of creating an updatable resultset ?
    This question is better directed at the
    "Java Database Connectivity (JDBC) & Transactions (JTA/JTS)" section of the forum. Maybe post a questions there, ensuring you give the URL of this question here too to avoid cross-posting.
    regards,
    Owen

  • Cant' update while select is active in read-committed mode

    Hi All
    I try to execute my java program the following error is comming
    "cant' update while select is active in read-committed mode"
    I am using prepraredStatement. The query is running successfully in QueryTool or Toad. But the Error is coming while execute this line
    "stmt.executeUpdate(); "
    pleaes solve my problem..
    Thankx

    <br>Mmm, it seems same question Re: insert data problem</br>
    <br>Nicolas.</br>

  • Update while selecting

    Is there any way in oracle where we update while selecting.
    I have a situation where I select a few rows from a table.
    Then I have to update those all those rows witrh some date as sysdate.
    I want to make sure that the rows I have selected are only updated and not a single new one.
    ex:
    select
    process something.
    update table set filed=sysdate where pk_col in (select --it is the same as 1st select );
    but in real time,
    when i select 1st time i get 40 rows.
    I process them.
    now i have to update just those 40 rows,
    but this time when I say
    update (select --its a second read.... this time select gives me 42 rows)
    maybe someone was working and he updated the table and I got 2 more rows.
    But as i processed 40, i want to update only 40 rows.
    So how can i be sure.
    Any ideas. please help.
    1 solution is to have a cursor and do the processing and updaing in the cursor.
    I process 40 rows and i update only those 40 rows in the cursor.
    other way, update when i select. i it possible.
    please let me know.
    meenakshi

    Hi.
    Check this please:
    CREATE TABLE aux_d
         id NUMBER,
         d_date DATE
    INSERT INTO aux_d VALUES(1,null);
    INSERT INTO aux_d VALUES(2,null);
    INSERT INTO aux_d VALUES(3,null);
    COMMIT;
    SELECT * FROM aux_d;
    ID     D_DATE
    1     (null)
    2     (null)
    3     (null)
    UPDATE
      SELECT *
      FROM aux_d
      WHERE id < 3
    SET d_date = SYSDATE;
    COMMIT;
    SELECT * FROM aux_d;
    ID     D_DATE
    1     14/07/11
    2     14/07/11
    3     (null)Hope this helps.
    Regards.

  • I need to restore my ipad but it won't restore because the software isn't updated and you can't update the software because it is in recovery mode.  What do I do know?

    I need to restore my ipad but it won't restore because the software isn't updated and you can't update the software because it is in recovery mode.  What do I do know?

    I would take it to the apple store to get recovery mode taken off.
    Regards.

  • You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels

    Hi, I have a piece of code that works fine in SSMS as T-SQL. When I put the T-Sql inside a SP, I get the error :
    You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels
    The script starts is as follows (only select)
    SET NOCOUNT ON
    Set Transaction Isolation Level Read Committed
    Set Deadlock_Priority Low
    Select......
    From MyTable WITH (NOLOCK)
    GROUP BY .....
    Order BY ....
    works fine as I said in SSMS as T-SQL but the SP generates the following
    Msg 650, Level 16, State 1, Procedure usp_TotalMessages, Line 15
    You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels.
    By the way, when it says line 15, from where we should start counting, is it from The USE DB statement which includes comments as well as Set ANSI....or should we start counting from the Alter PRocedure statement
    Thanks in advance

    Set Transaction Isolation Level Read Committed
    Set Deadlock_Priority Low
    Select......
    From MyTable WITH (NOLOCK)
    GROUP BY .....
    Order BY ....
    First you define transactionlevel = "Read Committed", then you use a query hint "NOLOCK" which is equivalent to "Read Uncommitted"; so what do you want now, committed or uncommitted, you have to decide.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • SP2013 Bug Report: Health Reports - You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels.

    There appears to be an error when trying to view Health Reports from Central Administration. A simple fix within a SharePoint Stored Procedure fixes the problem. I get the error message "You can only specify the READPAST lock in the READ COMMITTED or
    REPEATABLE READ isolation levels." when just trying to click "View Health Reports" --> Go in CA.
    I have found the same problem in some blog posts which leads me to believe this is a bug:
    Problems Viewing Health Reports in SharePoint 2013
    From the blog post "I managed to work around it by altering the
    proc_GetSlowestPages stored procedure and commenting out the
    WITH (READPAST) line. "
    This also worked for me. It would be great if a fix could be released for this problem as it seems to cause other problems as well (site analytics freezes).

    Hi Dennis
    Hope you had found the hotfix and installed it.
    For the benefit of others who visit this thread SharePoint Server 2013 Client Components SDK hotfix package addresses this issue.http://support.microsoft.com/kb/2849962
    Regards
    Sriram.V

  • Can't run command because user is in read-only mode.

    Hi
    I try to execute any sql statment i am getting this error.
    Can't run command because user is in read-only mode.

    user493528 wrote:
    I am having the same issue with Benthic when I do the With clause.
    I understand this is not related to Oracle but did anyone had issue related to this. I am getting the same error. Is it related to ODBC driver of how Benthic use to connect etc.,? I do not know.
    Thanks
    Gopihttp://www.benthicsoftware.com/support.html

  • Can iCal update while closed?

    OK, here's my problem: When I enter an event on my iPhone or iPad or on me.com, it only shows up in iCal after I open iCal. In other words, if I associate an alert with an event on my phone, that alert will never go off on my Mac, unless I left iCal open or I happen to open it sometime before the event.
    Now, I just spent some time on chat with Apple and was told that this is normal behavior, that iCal only updates from me.com when it's open. But Address Book updates just fine when closed. And I'm 99% sure that the me.com support guy was wrong, that iCal updates like Address Book. Or DID.
    Has the behavior changed? Have I lost my mind and iCal never, ever updates when closed?
    I'm willing to accept that I'm completely wrong about this, but I wanted to throw it out to the community and see if anyone else a) remembers the experience the way I do and/or b) knows of any workarounds/apps that will allow me to receive iCal alerts on my Mac without needing to leave iCal open all the time.
    Thanks!

    Under the old system, which used SyncServices as does Address Book, updates could take place even while iCal wasn't actually running.
    With the new MobileMe calendar, because iCal isn't really syncing but is reading the calendar off the MobileMe server (much the same as webmail) updates can only take place while iCal is actually running. This means that if you add an event with an alarm on another device while iCal is not running, the event won't be added until iCal is opened and may well be missed.
    In order to be sure you would need to run iCal but hide it, so that it won't be visible and in your way but can still update.

  • Vertical slider position not updated while displaying .pdfs with Adobe Reader X

    When a .pdf file is opened inside Firefox 4 (beta/RC1), the vertical slider position does not update while scrolling through the document until the mouse cursor is moved to the slider bar (then the slider immediately jumps to the right place).
    I am using Adobe Reader X.

    Here is a URL that will not save in Reader X:
    http://samplepdf.com/sample.pdf?meaningless=1234567890123456789012345678901234567890123456 789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 7890/&blah=blah.pdf
    However, if the last slash is removed or encoded as %2f (which should not be necessary, as it appears in the query portion of the URL), there is no problem.

  • Can't update my apps, brings me to sign in mode over and over

    I can't update my apps through the app store, it asks me to verify username over and over, also cannot download new apps

    Great advice, Christopher!  After THREE frustrating days, my husband realized that the home address listed for my iTunes account said Street Street instead of my street name!  How did this happen after years of no trouble?  Who knows.  We typed in the right address, and immediately all problems with downloading and/or updating disappeared.  Thank goodness!  I hope this helps the rest of you!

  • HT4623 how can i update while being unlocked

    Hi, Apple i just want to upgrade to iOS 6.0 but I'm unlocked with iOS 5.1.1 is there any way i could unlock iOS 6 FAST,EASY&FREE!
    is there a way to unlock iOS 6

    If your phone is officially unlocked, upgrading will not change that. If it is hacked to provide unlocking, good luck.

  • Javascript problem: can't update Select's option

    Hi All,
    I can't update a "Select" menu in a jsp page.
    What I want to do is to create a menu list where I can insert elements clicking on a input button that calls the JavaScript function 'addctypeformat':
    <input type="submit" name="addctypeformat" value="Add" onclick="confirmCtype('addctypeformat')">
    but when i call the JavaScript function, the new element appears and suddenly desappears in the select element.
    Here is the JavaScript code:
    <SCRIPT LANGUAGE="JavaScript">
    function confirmCtype(command) {
    if(command=='addctypeformat') {
    var current = "text_to_show_in_select";
    addformat.imgctype.options[addformat.imgctype.length] = new Option(current);
    </SCRIPT>
    Can anybody help me?
    Thank You very much
    David

    http://forums.webdeveloper.com has an excellent javascript forum.
    And probably if you change your input from type="submit" to type="button" it will work a lot better.
    The submit button will automatically reload the page for you - hence why it appears and immediately disappears
    Cheers,
    evnafets

  • Can Not Update Software

    Pls, My HTC one M8 is still on 4.4.3 kit Kat. I want to update it to 4.4.4 kit Kat. All attempts has failed as the phone keeps telling me I can only update while on CDMA mode. I live in Nigeria and my gsm carrier is not a CDMA, but only gsm. Anything you can do to help?

    If your phone is Verizon, You can only update Via the Network here in the States as soon as return back to the states you should be able to update.!

  • I can't update my songs

    I have had this big issue with my ipod for a while. About a month or so I guess it started. My sister downloaded a new itunes to my computer. I had to re-put all my songs in. So I update the iPod to get all my songs again and the new ones I added. Rather then update it gave me a warning saying it can't update it because it could not read the disk which was titled under my ipod's name.
    then I tryed restoring it, it worked for a little bit then it said something caused it to be unable to restore and it gave me some number along with the error. The first time that month ago I experienced it, I figured I needed to put my iPod CD in to re install it or something. Then when I finally found it this friday, I attatched my iPod to charge. It also added the original songs I wanted to update into it. I assumed the problem was fixed but it's starting to do all that again.
    Should I just put the CD in and re install everything or is this something thats wrong with the iPod? PLEASE Help! It's bad enough that the iPod is also having re-charging issues probably sue to the battery.

    Well, now when you try to restore, what's the error message that you're getting?
    CG

Maybe you are looking for