Rollback when an error occurs

Hi!
I process all the xml files from a directory (insert the data into some relational tables). I use a for loop cursor to process each file at a time. When an error occurs, I have to rollback all the inserts and process the next file, but when I try to rollback the transaction, the following error is raised:
ORA-01002: fetch out of sequence
I know that this explanation is terrible without a line of code, but what I need to know is: is there any special treatment when I work with XML extraction? (I'm using XMLTABLE to extract the data). Because I have the same logic with text files + external tables and it works fine.
Thanks.

I've just found the answer at http://it.toolbox.com/wiki/index.php/Wondering_%27ORA-1002_Fetch_out_of_sequence%27
(my cursor is not FOR UPDATE).
And, sorry, the problem was not with XML.
Bye...

Similar Messages

  • What happen when an error occurs during Snapshot-Refresh?

    Hi,
    I would like to know what happens, when an error occurs
    during a refresh (COMPLETE-REFRESH) of a snapshot?
    Is there a possibility for exception-handling??
    During a complete refresh the data in the snapshot will be deleted an the requested new from the master-side. Now when
    an error occurs during the refresh what happens with the "old" data of the snapshot??? Will it be lost?
    Thanxx
    Schoeib

    Each thread has its own error state. To get the results for a thread (including error result), you need to have a wait step which waits for it. If a thread has an error and you wait for it, you will get the error at the wait step that waits for it.
    If your main thread has an error and you want some worker thread to exit, you should add code to the cleanup of your main thread's sequence which signals the worker thread to exit (you should already have some sort of mechanism for signaling the worker thread to exit (there are many ways to do this, for example, a boolean variable passed by reference to the new thread's sequence, or a TestStand notification).
    If your main thread is getting an error, but is stuck inside a step, that problem is probably specific to something your code is doing, that is not the normal behavior of TestStand. You will need to provide more details or an example sequence in order for us to better understand what is happening.
    Hope this helps,
    -Doug

  • What happen when an error occur when there are 2 threads running ?

    Here is my execution :
    My MainSequence calls another sequence in a new thread. This sequence call a VI continuously
    When an error occur in the MainSequence, nothing happen : The step with the error in Mainsequence is still in execution state (with the arrow in front of it)  and the VI in my 2nd thread is still running. All I can't do is terminate all thread
    Is this behaviour normal ? What is the mean to solve this problem (maybe calling the 2nd sequence in a new execution ?)
    Thanks for your answer
    Laurent

    Each thread has its own error state. To get the results for a thread (including error result), you need to have a wait step which waits for it. If a thread has an error and you wait for it, you will get the error at the wait step that waits for it.
    If your main thread has an error and you want some worker thread to exit, you should add code to the cleanup of your main thread's sequence which signals the worker thread to exit (you should already have some sort of mechanism for signaling the worker thread to exit (there are many ways to do this, for example, a boolean variable passed by reference to the new thread's sequence, or a TestStand notification).
    If your main thread is getting an error, but is stuck inside a step, that problem is probably specific to something your code is doing, that is not the normal behavior of TestStand. You will need to provide more details or an example sequence in order for us to better understand what is happening.
    Hope this helps,
    -Doug

  • HT201210 What to do when an error occurs after the restoring process? my phone wont turn on anymore

    What to do when an error occurs after the restoring process? my phone wont turn on anymore

    The phone is telling you to plug in your phone to your computer. Do that then let it sit for a few minutes and then try it again and make sure itunes is open when you do

  • To display the same page when an error occurs.

    Hi,
      I need to display the same page when an error occurs in the page. For example, I am validating a few fields in a page. If an error occurs, then same page is to be displayed.
      I am presently using MVC type programming.
    Thanks in advance.
    Regards,
    Vara

    I usually use the Message class, for handling all possible validations. In the DO_HANDLE_DATA, do the validation, and if your validation fails, put your message in the message attribute available for that method. As you have not given a pointer to a new page, it will refresh that same page.
    If your validation is successful, go to next page.
    In the layout of this page(where you require validation), there is an attribute called page and it has get_message method. Call that method at the appropriate place in the layout.
    For more information , refer to :
    http://help.sap.com/saphelp_470/helpdata/en/91/b197ce280011d5991f00508b6b8b11/frameset.htm
    Web Applications and BSP --> Programming Environment -->
    Handling Incorrect Entries
    Let us know, if this answered your query.
    Regards,
    Subramanian V.

  • APP Store update iTune 11.0.2 install updates when an error occurs. (103)

    APP Store update iTune 11.0.2 install updates when an error occurs. (103)
    how to exclude this error,
    my computer is a MacBook Air, System 10.8.2 Please help, ...

    update itunes using the download site,  this worked for me
    http://www.apple.com/itunes/download/

  • How to capture the record value, when an error occurs

    Hi , can you please help us in achieving the below requirement.
    i have source with 10 accounts , i have to update the 5 target tables for the 10 accounts, i am using a for loop to do insert/update operations.
    when an primary key/unique constraint error occurs while doing the insert/update operations, i want to catpure that account number along with the
    error message and store in a table.
    right now i am using sqlerrm,sqlcode in my exception block to capture the oracle error code and error message,i need to capture the account number along with this message. please tell me how to achieve this ...
    thanks

    if you want to log the error in the table and keep going with the rest of them you might want to check out bulk collection exception handling.
    http://psoug.org/reference/array_processing.html
    CREATE OR REPLACE PROCEDURE forall_errors IS
    TYPE myarray IS TABLE OF tmp_target%ROWTYPE;
    l_data myarray;
    CURSOR c IS
    SELECT table_name, num_rows
    FROM all_tables;
    errors PLS_INTEGER;
    dml_errors EXCEPTION;
    PRAGMA EXCEPTION_INIT(dml_errors, -24381);
    BEGIN
      OPEN c;
      LOOP
        FETCH c BULK COLLECT INTO l_data LIMIT 100;
        -- SAVE EXCEPTIONS means don't stop if some DELETES fail
        FORALL i IN 1..l_data.COUNT SAVE EXCEPTIONS
        INSERT INTO tmp_target VALUES l_data(i);
        -- If any errors occurred during the FORALL SAVE EXCEPTIONS,
        -- a single exception is raised when the statement completes.
        EXIT WHEN c%NOTFOUND;
      END LOOP;
    EXCEPTION
      WHEN dml_errors THEN
        errors := SQL%BULK_EXCEPTIONS.COUNT;
        dbms_output.put_line('Number of DELETE statements that
        failed: ' || errors);
        FOR i IN 1 .. errors
        LOOP
          dbms_output.put_line('Error #' || i || ' at '|| 'iteration
          #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
          dbms_output.put_line('Error message is ' ||
          SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
        END LOOP;
      WHEN OTHERS THEN
        RAISE;
    END forall_errors;
    /

  • Why is exception not thrown in AseCommand when "Truncation error occurred"?

    In the below SQL, data is written to SOURCE and from there to TARGET.
    The DECIMAL columns in TARGET are deliberately smaller than those in SOURCE (eg a DECIMAL (12, 2) column populated from a DECIMAL (19,11) source).
    When I run this in an Query tool (eg, SqlDbx) I get the messages:
    "Truncation error occurred
    Command has been aborted"
    But when I run this using the .net Client (supplied with the Developer Edition of ASE 16.0) no exception is thrown (the INSERT fails though).  The method is AseCommand.ExecuteNonQuery().
    Is this deliberate? 
    Is this believed to be correct?
    How can I tell that a truncation error has been raised?
    Thanks
    IF OBJECT_ID ('dbo.TARGET') IS NOT NULL
      DROP TABLE dbo.TARGET
    GO
    CREATE TABLE dbo.TARGET
      S_Name_NVARCHAR NVARCHAR (50) null,
        S_RedComponent_DEC_15_6 decimal(15, 6) NULL,
        S_BlueComponent_DEC_12_2 decimal(12, 2) NULL, 
        S_GreenComponent_DEC_18_10 decimal(18, 10) NULL
    GO
    IF OBJECT_ID ('dbo.SOURCE') IS NOT NULL
      DROP TABLE dbo.SOURCE
    GO
    CREATE TABLE dbo.SOURCE
      Name_NVARCHAR      NVARCHAR (2000) NULL,
      RedComponent_DEC   DECIMAL (19,11) NULL,
      GreenComponent_DEC DECIMAL (19,11) NULL,
      BlueComponent_DEC  DECIMAL (19,11) NULL
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Beige', 272.195, 272.195, 244.42)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Bisque', 283.305, 253.308, 217.756)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('Black', 0, 0, 0)
    GO
    INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
    VALUES ('BlanchedAlmond', 283.305, 261.085, 227.755)
    GO
    --Is there data to migrate?
    SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
    FROM (
    SELECT * FROM SOURCE
    ) S
    --Yes.migrate away!
    --Next line gives a truncation error occurred in Sybase (gives a truncation error occurred in a query tool
    --but fails silently in AseCommand.ExecuteNonQuery).
    INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10)
    SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
    FROM (
    SELECT * FROM SOURCE
    ) S
    select * from dbo.TARGET

    Hi Dave,
    I am consulting internally on this. To my understanding, this behavior is based on the ASE severity level, as returned in the TDS_EED token. AseExceptions are thrown when severity level is 11 or higher.
    Our docs are not explanatory in this regard.  Once I get clarification we will provide something in the form of wiki or KBA or doc bug to further explain the detail.  Apologize for the delay and problems this caused. I guess since the command is aborted by ASE, therefore no insertion occurs, even though ASE indicates truncation occurs prior - makes this confusing.
    The message severity, etc is controlled by ASE and the client is just following suit according to the TDS spec. Its just lacking in the client docs. This can be remedied.
    ASE does provide the option to allow truncation and not abort.  It's a set command:
    Enter a query:
    1 > set arithabort numeric_truncation off
    Enter a query:
    1 > INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10) SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC FROM (SELECT * FROM SOURCE
    ) S
    4 rows Affected.
    Notice though ASE does NOT send truncation message. This is when it is well known and accepted to insert and truncate the numeric data.
    Cheers,
    -Paul

  • Report Still Runs When Validation Errors Occur

    Hello.
    I'm using Apex 4.2.1 against Oracle 11gR2 and Oracle App Server (mod_plsql).
    My Set-Up:
    I created an application containing a "classical" type report that is driven by a WHERE clause. I also have two date fields in an HTML region on this same page. These fields are used in the report WHERE clause. And the report is run by clicking a GO button on the page.
    Here's what the WHERE clause looks like:
    where table_date >= to_date(nvl(:P1_BEGIN_DATE, '01-jan-1900'), 'dd-mon-yyyy') and table_date <= to_date(nvl(:P1_END_DATE, '31-dec-2300'), 'dd-mon-yyyy')This is designed so that, if any of the date fields are NULL, then the minimum or maximum date will be used for the query.
    These date fields should always have a value when the report is run, and so, I created two after submit NOT NULL validations, one for each of the date fields. If any of these fields is NULL when the GO button is clicked, an error message appears in the notification area at the top of the page.
    Looking at all this, you might realize (as I do) that the nvl() functions in the above WHERE clause are redundant. After all, the validations are supposed to prevent these date fields from becoming NULL when the report is run. In any case, this set-up does work ok and points out a strange behavior with Apex.
    My Problem:
    If any of these validations throws an error message, the report still runs. In previous versions of Apex, if a validation (or, for that matter, any error) is thrown, the report remains static. The report region does not disappear and the report is not invoked until the user corrects the error.
    If both date fields are filled, I click the GO button and the report correctly returns, say, 100 rows. But when I empty both of the date fields and click GO, the validation errors appear and the report still runs, now returning the maximum number of rows, say, 1000.
    What I've Tried:
    I added a Branch-to-Page with condition "No Inline Validation Errors Displayed" so that the page branches back to itself only when no errors appear inline and I changed the validation error messages to appear inline. This has no effect.
    And if I remove the nvl() functions from the above WHERE clause, then, when validation errors are thrown, the report data is replaced with the "No data found" message. All very disconcerting to my users.
    Does anyone know why Apex reports are still run in presence of validation errors?
    And how do I get around this behavior?
    Thank you for any help.
    Elie

    Hi, Scott.
    Thank you for your help/suggestions.
    I like your first suggestion: creating a DA on the GO button that causes my report region to refresh only if both begin and end date fields are populated. And so, I tried doing this.
    My DA looks like:
    Event: Click
    Type: Button
    Button Name: P1_GO
    Condition: - No Condition -
    Action: Refresh
    Fire When Event Result Is: True
    Fire On Page Load: Checked
    Selection Type: Region
    Region Name: People Count
    Event Scope: Static
    Condition Type: PL/SQL Function Body Returning A Boolean
    My PLSQL Code in Expression 1:
    IF ( (:P1_BEGIN_DATE IS NOT NULL) AND (:P1_END_DATE IS NOT NULL) ) THEN
      RETURN TRUE;
    ELSE
      RETURN FALSE;
    END IF;My P1_GO button was automatically changed to "Controlled by Dynamic Action". And "Execute Validations" for this button is set to "Yes".
    Unfortunately, this DA does not work. When both date fields are filled, clicking the GO button does not cause the report (nor anything else) to refresh. However, if I navigate to another application tab and then return back to my report page, I notice that the report does refresh at that point. But clicking the GO button has no effect.
    And when either or both of the date fields is NULLed, clicking the GO button does not cause my validation error messages to appear.
    By the way, I do agree with your comment about the NVL() functions. As I had mentioned in my original post, I also realize that, with my WHERE clause, checking for NULLs in my date fields is not needed. Still, if users fail to fill these date fields, then it would be useful to remind users that these fields should be populated. This is why having the validation checks are still needed despite my WHERE clause.
    In any case, would you know what I am doing wrong here with this Dynamic Action?
    Also, with respect to my first question, why is Apex causing my report to refresh when validaion errors have occurred? This did not occur prior to version 4.2.
    Thank you very much for any further help/advice.
    Elie

  • Downloading Quicktime when "unknown error" occurs

    I am unable to download QuickTime because when I run the download a sign comes
    up saying that: "QuickTime 75_Panther could not be opened, because an unknown
    error occurred", Further it says:"Try saving to disc first then opening the file". How and what do I do to take care of this?

    1) i have the latest version of itunes (7.2.3?)
    2) i have tried different CDs, but they all generate the same error
    3) the CDs i'm using are not enhanced; they're just regular CDs
    4) changing the format helps sometimes; instead of giving an error right away, it lets me import 1 or 2 songs before the error message appears
    5) yup
    the problem is actually worse now! now when i try to import a CD the entire iTunes application shuts down. any ideas anyone?????

  • I was downloading ios 8 on the iphone 4 when an error occurred and now the white line froze just before it finished.  what do i do?

    iphone 4 froze after error occured during ios 8 update, how do i fix it?

    Please use the search box at the upper right hand corner of this page.  Your question has already been asked and answered multiple times.

  • DocCheck output could be improved when no errors occur

    I am using DocCheck and find the output very useful if errors or warnings occur, but not very useful when there are no errors or warnings. In the latter case, the Executive Summary explains the table columns where there is no table, the Package Summary gives a note about the Minor Errors table which also isn't there and the Package Statistics merely states the number of packages checked. What I would like to see is an overview of the packages that are checked, much like the situation where there are errors or warnings.
    Is there any way to control the output for this situation so that it always produces the output in the same format?

    Wow. No errors. Congratulations!
    Seriously, you have both bug requests and an enhancement request, here.
    The bug is that when a table is empty, there should be text under the heading
    that says "no errors found" or words to that effect. That's a minimum level of
    functionality the program should include.
    For the enhancement, you would like to see "an overview of the packages that are
    checked, much like the situation where there *are* errors or warnings", but I'm
    having a hard time figuring out what that would mean, in practice.
    There is an overview of the packages checked on the executive summary
    page, under "No Errors Found" (no point in using a table, since the number of
    errors and percentage of errors columns would be zero).
    The package summary pages, too, only show counts of errors, so if there are
    no errors, there isn't much to show on that page.
    On the statistics page, the first table should show number of classes, nubmer
    of interfaces, etc. That should still be present, even with no errors. The next
    two tables are nothing but error-distribution tables, which again would say
    nothing at all if no errors were present.
    Are you saying that you'd like some global statistics table that broke down how
    many classes in a package, how many methods in the class, or things to that
    effect? (That might be a useful enhancement, at some point.)
    I think part of the problem may be that, since you're not seeing the tables (which
    is a good thing) it's not clear just how little they would contain! Without errors to
    report, there is nothing to put in the columns. (The only exception is "Items Inspected"
    -- the first table at the top of the statistics page.
    In general, DocCheck works on the concept of "exception reporting". It only shows
    errors, so you don't have to scan through a huge report in an attempt to find them.
    I can see where it could be helpful to see how many things there are that don't
    have errors, though. That way, for example, you could tell that you added 50 methods,
    all without error.
    That raises the bar from an error-detecting tool to an error-management tool, but
    I suspect that it is a useful goal to pursue.

  • Exiting from OSB pipeline when application error occurs

    Hi
    My proxy exposes 3 operations to the consumers though WSDL with different inputs and similar output formats. For all these 3 operations there is a common service to be called before actually get into the operational branch that i created for handling these operations. so the message flow would be like below:
    pipelinepair1 -> stage1 in pipeline1 ->service callout -> opeartional branch.
    I am manipulating the response n respone line of pipeline1 for all the operations as its similar strcuture. If an application error arises in service callout the error will be in the body. so if the error raise i should directly exit from message flow in service callout itself wthout proceeding to operational branch. So i tried with reply action, though i am existing from OSB its not going into response pipeline of pipelinepair1. How can i handle this scenario? i don't want to put the same thing in service callout response pipeline again. Please let me know your insights.
    Thanks
    Siva

    This could be done in different ways... why you need to manipulate the response in response pipeline only.
    When your service call out fails do a 'Raise error' action.. and process the reply in stage error handler which will complete with a "reply with failue ( or success) action. if you have not configured an stage error handler, you need to do this in the service error handler.
    As this is an error case it is apt you handle this at the error pipeline( stage or service error handler) rather than the response pipeline.

  • Records aren't updated in batch processing when an error occurs

    Hi folks,
    We are facing a problem using batch processing with oracle. Our app is implemented without any framework (Struts, Hibernate, Spring, etc), using basic statements and the "auto commit" option is turned off.
    When there's no errors into statements, everything goes fine! But, when one of commands doesn't execute succesfully, we can't commit others statements. Although specs say all of the previous statements should be committed when we explicit commit the transaction.
    Does anyone have any idea about the source of this problem?
    Thanks,
    Auler.

    Well, last time I checked, this was NOT a database forum, it's a "SQL and PL/SQL" forum, isn't it? Yes, SQL and PL/SQL run on the database, but they also run at the application level as well when you're working with Oracle Forms and Reports, which both have a built in PL/SQL engine.
    And yes, I AM using RUN_PRODUCT...*before* I use the win_api_session call. I run the report, and THEN attempt to open the finished report once it has been written to file. But I can't do that if the report is still being generated, right? My RUN_PRODUCT call passes a parameter to tell it to close the Reports Background Engine once the report has been generated. So, what I do is test (using win_api_session) to see if the Reports Background Engine is open or not. WHILE (my loop here...see my last post) it's open, I loop, so that when it is no longer open, I know that my report has been generated, and I can make the call to attempt to open the report from file.
    Again, what I need to do, is figure out how I can put some sort of error handling inside my loop to handle situations where there may be some sort of error in generating the report, and the Reports Background Engine doesn't get closed, which would leave me stuck in the loop.

  • I was updating my iPod touch to 4.2.5 when an error occurred and now my iPod is not recognized by my computer or under devices in iTunes.  My iPod is also stuck on a screen saying to connect to iTunes.  I tried resetting my iPod and it did not work.

    Please help!  I was updating my iPod to 4.2.5 and iTunes said that it was preparing my iPod for update.  Then an error popped up and now my computer won't recognize my iPod and it doesn't show up under devices in iTunes.  All it has on my iPod is a picture of a USB cable with an arrow pointing to the iTunes logo.  I tried resetting my iPod and it just restarts to the same picture.  I tried restarting my computer as well.

    What was the error number?  That would be very useful since the following gives actions for various errors.
    http://support.apple.com/kb/TS3694
    Try manually placing the iPod in recovery mode to see if that will make the iPod visible in iTunes.  See:
    http://support.apple.com/kb/HT1808

Maybe you are looking for

  • Resolution problem

    How can I improve the resolution of files?  When clients upload files, they get a resolution warning for prints larger than 5x7.  Never had this problem with Photoshop Elements.  I have increased the file size to largest/100 on export.

  • Why my ipad cannot open the video youtube?

    I use my Ipad3 to watch youtube more than 6 months, but today when I  click play youtue to watch, It keep upload the video forever. Please advise.

  • How export a pie graph(displayed in jspx page) into a PPT file.

    I am trying to export a pie graph(displayed in jspx page) into a PPT file using Apache POI. But I am facing a problem when I calling the below mentioned code from a button. Code: SlideShow slideShow = new SlideShow(); Slide slide = slideShow.createSl

  • Log4j:ERROR Could not instantiate configurator

    I use -Dlog4j.configuratorClass=mypackage.Log4jConfigurator java option in startWeblogic command file to read changes in log4j-config.xml. After that I have in console.log og4j:ERROR A "mypackage.Log4jConfigurator" object is not assignable to a "org.

  • How to Install Patch 3944888: EBS-OFO integration patch for PLM Family

    Dear Oracle, I just Download Patch 3944888: EBS-OFO integration patch for PLM Family Pack 11.5.10 E. Unfortunately after unzip the file and read the readme file, i can't found the installation guide or instruction to install the patch. Does anybody k