Db batch update problem

I have a real problem with doing a batch update in SOA Suite and have tried a number of different approaches but they have all failed at some point. My requirement is really quite simple.
I have a simple table - MY_TABLE:
Columns:
PK_ID - primary key
ATTR_1 - not a primary key but selection criteria for on which to update.
ATTR_2 - value to update
In oracle the above update statement would look something like:
update MY_TABLE set ATTR_2=<some value> where ATTR_1=<some value>
However I don't want to update a single row, I want to update a number of rows at the same time based on a number of different ATTR_1 values. So my approaches so far have been:
a) use the Update functionality of the DB Adapter. The problem with this is that the DB adapater insists on updating by primary key. I do not have the primary key, I have another column for which I want to use as the criteria. So this won't work.
b) Create a two stage process whereby I retrieve the primary keys based on ATTR_1 and feed this into approach a). Problem is that now I need to do a select based on a list of ATTR_1 values. The Select feature of the DB adapter does not allow selection based on a number of attributes, just one. i.e. the SQL that it creates for you is something like SELECT VALUES FROM TABLE WHERE CRITERIA = <some value>. What you would really need is SELECT VALUES FROM TABLE WHERE CRITERIA IN <some value>, but the Select feature won't allow this.
c) This brings me on to the next approach. So I am going to try and use the DB adapter in Pure SQL mode. The SQL I define is something like:
update MY_TABLE set ATTR_2=#myValue2 where ATTR_1 in #myValue1
To get this work I have had to do some XSLT to convert my repeating element of ATTR_1 into a concatonated string e.g. ('myValue1','myValue1','myValue1'). The XSLT to do this sort of broke the XSLT GUI in SOA Suite, but it seems to work at runtime and creates the correct XML request to the DB adapter, however no rows are being updated and there is no error message either.
This simple DB update is seemingly beyond my grasp. Can anyone help?
Also I have no intention of looping through BPEL doing a single update at a time. The performance hit for a large number of records would be prohibitive.
Edited by: user10103872 on 28-Nov-2010 10:42
Edited by: user10103872 on 28-Nov-2010 10:43

>
I am thinking to write a procedure call to loop the sql statement "update table_A set version_no='1';"
>
Please don't do that. That will result in other complex issues and is not the solution to this problem.
When you try to do any insert, update or delete, Oracle generates UNDO (which basically has all the data to revert back the changes, in case you decide to do a rollback).
In your case, the UNDO Table space is not sized appropriately for this large update that you are trying to run. So, you need to fix that, by sizing it appropriately or by Using Auto-Extensible Table spaces.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/undo.htm#BABJCFFE

Similar Messages

  • Oracle Batch update problem

    Hi,
    I have a queer problem with batch inserts in oracle, loaded on a sun solaris m/c.
    I'm trying to do a batch insert using the executeBatch() api of java.
    I am able to do batch insertions from my workstation i.e win2k properly . But i'm unable to do so when i run the program on the sun solaris m/c.(The data base is the same)
    Since the JVMs are different i have a feeling it could be the oracle JVM that is giving the problem.
    Please advice me as to how i can overcome this.

    I am having the same problem with a 9i installation on Win2k. My code works fine when run in the Sun JVM on a client. When I try to executeBatch in the Oracle JVM, I get "java.sql.BatchUpdateException: Internal Error: oracle.jdbc.kprb.KprbDBStatement".
    I am using what I thought was the standard preparedStatement.addBatch() and preparedStatement.executeBatch() APIs.
    I see in the SetExecuteBatch.java example the use of connection.setDefaultExecuteBatch(int) and preparedStatement.executeUpdate(). Is this usage required when running in the Oracle JVM? What if I set my batch size to 10000 but I only have 9000 rows in the last set -- how do I force the batch to execute on the smaller set?

  • Problem with Batch Updates

    Hi All,
    I have a requirement where in I have to use batch updates. But if there's a problem in one of the updates, I want the rest of the updates to ingore this and continue with the next statement in the batch. Is this not one of the features in BatchUpdates in JDBC2? I have been trying to accomplish this since 2 days now. Can anyone help me with this. Can anyone please help me with this?
    FYI, I have tried the following.
    I have 3 test updates in my batch.
    2 nd statement is an erraneous statement(deliberate). Other 2 statements are fine. It is appropriatley throwing 'BatchUpdateException'. when I ckeck the "arrays of ints" reurned by executeBatch() as well as BatchUpdateException.getUpdateCounts() are returning an arrays of size '0'. If remeove the erraneous statement, behaviour is as expected.
    Thanks in advance,
    Bharani

    The next paragraph of the same API doc:
    If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getUpdateCounts will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:
    3. A value of -3 -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails
    A driver is not required to implement this method.

  • JDBC Batch Updates & PreparedStatement problems (Oracle 8i)

    Hi,
    we're running into problems when trying to use JDBC Batch Updates with PreparedStatement in Oracle8i.
    First of all, Oracle throws a SQLException if one of the statements in the batch fails (e.g. because of a unique constraint violation). As far as I understand, a BatchUpdateException should be thrown?
    The next problem is much worse:
    Consider this table:
    SQL> desc oktest
    ID NOT NULL NUMBER(10)
    VALUE NOT NULL VARCHAR2(20)
    primary key is ID
    When inserting in through batch updates with a PreparedStatement, I can pass 'blah' as a value for ID without getting an exception (Oracle silently converts 'blah' to zero). Only when the offending statement is the last statement in the batch, Oracle throws an exception (again, SQLException instead of BatchUpdateException).
    Any comments/suggestions are appreciated.
    E-mail me if you want to see the code...
    Thanks,
    Oliver
    Oracle version info:
    (Enterprise Edition Release 8.1.6.0.0, JServer Release 8.1.6.0.0, Oracle JDBC driver 8.1.6.0.0 and 8.1.7.0.0 (we're using the 'thin' driver)
    CLASSPATH=/opt/oracle/product/8.1.7/jdbc/lib/classes12.zip:...
    null

    Please refer
    http://www.oracle.com/technology/products/oracle9i/daily/jun07.html

  • Batch Updates Using Oracle

    Hi,
    We are currently having problems saving data using Weblogic 6.1 sp1 and Oracle
    8.1.6. we are using Weblogic JDBC Drivers for Oracle. The data we are saving is to
    the extent of 25-50,00 records. When we are trying to this we are getting transaction
    timeout errors since this saver process is taking more than 30 seconds which is out
    rimeout limit.
    Can we do this using Batch updates?? Any code snippets or pointers will be grealty
    appreciated.
    Thank YOu,
    Sanjeev

    Can you be more specific?
    - What do you want to do exactly?
    - What are your OS and Reports versions?
    At first, it sounds a bit strange to use Reports for batch updates. A pl/sql procedure may be more suitable.
    You can schedule a report in several ways, e.g. via CRON on Unix (see RWRUN command in the 9iDS Help)).
    You can do the same via the database using the SRW package (see http://download-west.oracle.com/docs/html/A92102_01/pbr_evnt.htm#1005558 )
    You can use the Reports Queue Manager.

  • A reason of disabling of Batch Updating by a CHAR type

    Hi all,
    Why, when there is a table column of CHAR datatype, does JDev disable Batch Updating feature in "Tuning" page of Entity object?
    Is this related to that, that CHAR datatype blank-pads a value, of cause if the latter is shorter that the CHAR column length?
    I'm interested not in the technical aspect of this (as we know, this is done by setting Refresh After Insert/Update checkboxes of the corresponding CHAR field) but in some other aspect or implication of doing that by a JDev.
    JDev version is 10.1.3.3.0.
    Regards and thanks,
    Yerzhan.

    Hi,
    Thank you for ur answer.
    I've followed the procedure that you have explained and the Quantity 3 have been succefully passed to VA01 but is set to zero when i execute the next OK-CODE (=UER2, i think it is llike Enter button ). I simulate the same procedure by creating a sales order on VA01 and i've finally found the problem : at item level, if i enter the Material (MATNR), the order Quantity (KWMENG) and the Reason of rejection (ABGRU), the quantity is set to zero after clicking the enter button ; but if i enter only The material and The quantity followed by enter button, and enter after the Reason of rejection, it works fine, the Quantity doesn't change.
    What is the solution that you propose to me?
    I've try this one on debugger mode:
    The FM which interpret the Idoc create the sales order by CALLING TRANSACTION 'VA01' USING bdcdata....
    I've modified the bdcdata to implement the sequence of the steps before (MATNR + QTY <ENTER> ABGRU <ENTER>).
    1. Is it possible to code this modification?
    2. Is there a way to structure the Idoc for having this sequence in bdcdata?
    Thanks in advance!
    Narivelo

  • Batch Updates in JDBC2

    Hi All,
    I have a requirement where in I have to use batch updates. But if there's a problem in one of the updates, I want the rest of the updates to ingore this and continue with the next statement in the batch. Is this not one of the features in BatchUpdates in JDBC2? I have been trying to accomplish this since 2 days now. Can anyone help me with this. Can anyone please help me with this?
    FYI, I have tried the following.
    I have 3 test updates in my batch.
    2 nd statement is an erraneous statement(deliberate). Other 2 statements are fine. It is appropriatley throwing 'BatchUpdateException'. when I ckeck the "arrays of ints" reurned by executeBatch() as well as BatchUpdateException.getUpdateCounts() are returning an arrays of size '0'. If remeove the erraneous statement, behaviour is as expected.
    Thanks in advance,
    Bharani

    Cross posted...
    http://forum.java.sun.com/thread.jsp?thread=392858&foru
    =31&message=1701232there's no post
    like a cross-post
    it's the most annoying thing around
    so if you want
    to get some help
    don't cross-post yourself into the ground

  • Batch updates -- JDBC

    Does any body when I do a batch update, how to track if a particular insert statement has failed in that batch...
    I know that batchUpdate retruns an int[] updatecount.. but, does it tell me which row was not inserted...
    Please help

    I have problem with executeBatch() too. I tried to simulate one error out of other 99 correct data rows by inserting a string into a date field, suppose I should get updateCounts result -3, but I got SQLException and all these 100 rows were not been inserted into database.
    Any idea? Thanx.

  • Statement caching and batch update

    Can these 2 JDBC features work together ?
    Is it possible while statement is cached to be reparsed (soft) if used in batch update ?
    I am asking this questions because i have a sitution where an insert is cached using implicit statement caching and then put in a batch to exeute batch updates !!! From statspack reports i find that 1/3 of statements are reparsed ... even soft !!!

    Statement caching and batch update work fine together. The most common cause of unexpected soft parses is changing the type of some parameters. If you first bind one type, setInt(1, ...), do addBatch, then bind another type to the same parameter, setString(1, ...), and do addBatch, you will get a soft reparse. There is nothing the JDBC driver can do about this, the RDBMS requires it.
    In general, whatever parse behavior you see with statement caching you would also see without it.
    Douglas

  • Error while running batch update statement

    Hi
    We are experiencing the below error while running the batch update statement where in the IN clause have more than 80,000 entries. The IN clause is already handled for max 1000 values so it has multiple or clause
    like update...where id in (1,2...999) OR id in (1000,1001........) OR Id in ()...
    Error at Command Line:1 Column:0
    Error report:
    SQL Error: ORA-00603: ORACLE server session terminated by fatal error
    ORA-00600: internal error code, arguments: [kghfrh:ds], [0x2A9C5ABF50], [], [], [], [], [], []
    ORA-00600: internal error code, arguments: [kkoitbp-corruption], [], [], [], [], [], [], []
    00603. 00000 - "ORACLE server session terminated by fatal error"
    *Cause: An ORACLE server session is in an unrecoverable state.
    *Action: Login to ORACLE again so a new server session will be created
    Is there a limitation of oracle or some bug?
    Thanks

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/limits003.htm
    The limit on how long a SQL statement can be depends on many factors, including database configuration, disk space, and memoryI think you're over this limit.
    The only way is creating a temporary table with all the values and using
    IN (select ...)Max
    http://oracleitalia.wordpress.com

  • Batch updates with callable/prepared statement?

    The document http://edocs.bea.com/wls/docs70/oracle/advanced.html#1158797 states
    that "Using Batch updates with the callableStatement or preparedStatement is
    not supported". What does that actually mean? We have used both callable and prepared
    statements with the batch update in our current project (with the Oracle 817 db).
    It seems to run ok anyway.

    So the documentation should state that batch updates do not work ok in old versions
    of JDriver for Oracle, BUT work correctly with newer version. Additionally, batch
    updates work ok when used with Oracle supplied jdbc-drivers?
    "Stephen Felts" <[email protected]> wrote:
    Support for addBatch and executeBatch in the WLS Jdriver for Oracle was
    added in 7.0SP2.
    It was not available in 6.X or 7.0 or 7.0SP1.
    "Janne" <[email protected]> wrote in message news:3edb0cdc$[email protected]..
    The document http://edocs.bea.com/wls/docs70/oracle/advanced.html#1158797
    states
    that "Using Batch updates with the callableStatement or preparedStatementis
    not supported". What does that actually mean? We have used both callableand prepared
    statements with the batch update in our current project (with the Oracle817 db).
    It seems to run ok anyway.

  • Inbound IDoc SHPCON - Batch update issue

    Hi all,
    I would like to use SHPCON.DELVRY03 idoc in order to update Outbound delivery document.
    Scope is :
    - picking
    - good issue
    - update batches
    - update serial numbers
    - update volume and weights
    We met issue on update batches a soon as one document item already has batch information before receiving IDoc.
    2 cases :
    - no batch spliting => High level item has already a linked batch (LIPS-POSNR = 000010 and LIPS-CHARG not empty.
    Is there a way to update batch information if external warehouse confirms another batch number ?
    - batch splitting => High level item has already 2 sublines POSNR = 900001 & 900002. Both has batch numbers.
    If I want to confirm it, I can send E1EDL19 with BAS qualifier but sublines are added...
    Must I delete existing sublines with E1EDL19 DEL ?
    Thanks a lot for your help.
    J.C.
    and to post good issue.
    All is OK except

    Hi,
    We are having same issue as of yours...
    i.e Updation of batch via IDOC to the delivery if delivery contains batch ...its not happening and also idoc not throwing any error
    Did you able to resolve this ?
    Thanks
    Rajesh

  • Update problem - VBDATA table

    Dear All,
    We have update problems in our Quality systems, and also in every R/3 system that we create from a Production system copy.
    Sometime the UPD and UP2 work processes hung without apparent reason.
    In the SM50 I can see one or more of my update processes running for a lot of time (many hours) on the table VBDATA without perform any action.
    In the tcode SM12 I donu2019t see any kind of lock, and I donu2019t understand why only sometime this problem happens.
    Of course, from the SM13 I can see that during this problem the system is not able to perform any kind of update.
    As I told in the beginning of the message, I have the same problem in other two R/3 systems, both created with a system copy from the production system.
    The Production and the Developer systems seem not affected by this problem.
    Have you got any idea about the reason of the problem?
    Even if the Production systems is not directly affected, all the IT department is not able to work on the Quality system (or any other Test system), and the only workaround is to kill the UPD (or UP2) WPs affected.
    Thanks in advance,
    Federico Biavati
    My R/3 System is a 4.7 on SLES9 and Oracle 10.2.0.2

    Hello Siva,
    This is what I did:
    > Check how many entries do you have in VBDATA currently.
    More than 1.000 in every SAP systems that Iu2019m creating from Production
    > You might want to run the reorganize updates program to clear the old updates
    > that are pending/in error
    Good point!!
    After the reorganization (ST14 u2013 Reorganize update requests) the table VBDATA is empty.
    Iu2019ll check and Iu2019ll let you know if the problem is definitively solved.
    Thanks for you help,
    Federico

  • Chart x scale update problem

    LabVIEW  8.5.1
    Sweep Chart Problem
    The x scale values do not update until after the 2nd sweep.  The red line cursor gets to the end of the sweep and starts the next, but the scale numbers do not update until the next sweep starts.
    It appears to be a problem with the chart, since it happens with any vi with a sweep chart.  I've used versions 6 through 7 for years and never seen this.  I've only recently moved to a new job with a new machine and version 8.5.1., so I'm not sure what to try.
    I've included a simple example.
    Thanks much,
    JSC321
    Attachments:
    Chart Sweep Scale Update Problem.vi ‏32 KB

    You have a typical race condition!
    There is no data dependency between the property node and the while loop, so in your case the loop starts executing first and the property node starts slightly later, immediately erasing the first point. Execution order is not defined.
    All you need to do is add a data dependency, e.g. as with the error cluster in the image. This forces the property node to complete before the loop is allowed to start.
    (Execution order is enforced even if the wire value is not even used inside the loop )
    Try it!
    Message Edited by altenbach on 12-23-2008 11:08 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    HistoryRace.png ‏10 KB

  • Oracle 10G AS, Batch Update doesn't commit.

    Hello,
    We are using Batch uptdate to commit a set of records, but to our surprise one of the batches commits in DB and the other doesnt.
    The below pseudo code explains our scenario :
    String str1="INSERT INTO TBL1 (COL1,COL2) VALUES (?,?) ";
    String str2="UPDATE TBL2 SET COL1=? WHERE COL2=?";
    PreparedStatement pstmt1=conn.prepareStatement(str1);
    PreparedStatement pstmt2=conn.prepareStatement(str2);
    for(500 recs)
    pstmt1.addbatch();
    pstmt2.addbatch();
    On 500 Recs
    //This batch updates the DB and commits too
    pstmt1.executeBatch();
    pstmt1.clearBatch();
    con.commit();
    //The Batch executes successfully, but updates are not reflected in DB,
    //which may mean that it must not be committing in DB
    pstmt2.executeBatch();
    pstmt2.clearBatch();
    con.commit();
    - In the above, pstmt1 is an INSERT and pstmt2 is an UPDATE.
    - It so happens that at the end, DB reflects Inserts done by pstmt1, but it doesnt reflect the Updates of pstmt2.
    - We have also fired a SELECT stmt immediately after pstmt2 Execute Batch, but the updated values are not reflected.
    - Also the above scenario works absolutely fine if we use a STATEMENT instead of a PREPAREDSTATEMENT for pstmt2.
    Set up Details:
    App Server :: Oracle 10G AS for Linux 2.1,
    Database Driver :: Oracle 10G Driver which is bundled with Oracle 10G AS
    Database :: Oracle 9i
    Any ideas in this regards would be highly appreciated.
    Thanks !
    - Khyati
    Message was edited by:
    user473157

    I think this is not the right forum for this question; probably a JDBC forum or one of the Oracle AS forums.
    Kuassi

Maybe you are looking for