Re: Batch updates & deletes

John,
I suspect that you could accomplish what you want like this:
Pass the values needed in your WHERE clause to the SQL method, and use them
as host variables in the SQL statement. Something like this:
.....deleteTableBlah(p_One, p_Two, ...., p_N) ;
deleteTableBlah(p_One: Textdata, p_Two: TextData, ...., p_N: Textdata)
SQL
delete from tableBlah
where ColumnOne = :p_One
and ColumnTwo = :p_Two
and ColumnN = :p_N .... and so on
If there is a large number of values to be passed you could pass an object
and parse the values in the SQL method.
I hope this helps.
/\/\ark /\/ichols
Forte Technical Consultant
[email protected] on 03/16/99 11:12:03 PM
Please respond to [email protected]

Hello,
I'm not sure how you are going to do the comparison as a batch and not record by record. A JPA query will give you objects back which you can use to compare and make changes to as neccessary. When you commit, the JPA provider will commit those changes to the database for you. TopLink/EclipseLink has options to efficiently comit those changes, even combining them into batches where possible. See http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#How_to_Use_Batch_Writing_for_Optimization for details on using batch writing in EclipseLink.
Best Regards,
Chris

Similar Messages

  • Batch updates & deletes

    Hello,
    I was wondering whether it was possible or not to perform batch updates and
    deletes using dynamic SQL.
    The SQL will have where clauses in them, so unfortunately it isn't a simple
    'delete from table_blah'.
    We are using Oracle if that matters.
    Any help would be appreciated,
    John Twomey
    CSC
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Could you please clarifiy me on below regarding standby databases. Oracle version is 11gR2.
    1) Suppose if we have physical standby database configured using active data guard, how to schedule jobs/pl sql procedures running on standby database daily? What those procedures will do?
    DML operations will not allowed only Read only operations.
    2) I heard if there are batch updates/inserts/deletes happens on primary, then performance will be impacted on logical standby due to SQL apply. Is it true.When there is lot of Trasactions then the same amount of SQL's has to apply on standby, When there is no concern on primary due to high trasactions why worrying of standby?
    3) Can we run expdp/impdp on logical/physical standby databases?Check *How to use Data Pump Export (expdp) to export from Physical Standby Database [ID 1356592.1]*
    There is a great discussion before one month in below thread, check it.
    Check expdp on physical standby

  • 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

  • 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

  • HTML Article Management: Is there an easier way to perform batch updates?

    I have a folio with many html articles.
    After a batch of edits I need to update the folio via FolioBuilding panel.
    I've tried 2 ways both however both are time consuming;
    1) via Updates: updating is time consuming because i have to select each artcle, go to menu select update, wait till complete, repeat for each article.
    2) via reimport: select each article, go to menu & select delete, wait till complete, repeat for each article then re-import all articles
    Is there an easier way to accomplish batch updates?
    Thanks,
    John

    Just use "import" & the sw insts' will load and assign accordingly, automatically.
    But oddly, there are times when importing a SMF w/imbedded prgm changes, that LP8 loads a completely wrong instrument to a specific track(s).
    One reason that I've kept only one of my trustworthy external midi modules (Roland XV5080), specifically for just importing SMFs'. When the XV is in GM mode, any standard midi files I import to LP8... always load pgm changes correctly 100% of the time.

  • Batch Updates with Toplink/JPA

    Hi All,
    I am new to JPA/Toplink and I wonder is there a way that we can do the batch updates/insertions using the JPA? If yes please help me how to do it?
    My requirement is this, I need to fetch the n number of records from database and compare with the records from a file and insert/update/delete as required.
    I don't wanted to do it one by one record but as a batch. Is there a way that I can do batch updates/inserts/deletes?
    Any suggestion would be appreciated.
    Thank you.

    Hello,
    I'm not sure how you are going to do the comparison as a batch and not record by record. A JPA query will give you objects back which you can use to compare and make changes to as neccessary. When you commit, the JPA provider will commit those changes to the database for you. TopLink/EclipseLink has options to efficiently comit those changes, even combining them into batches where possible. See http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)#How_to_Use_Batch_Writing_for_Optimization for details on using batch writing in EclipseLink.
    Best Regards,
    Chris

  • Batches Updates VS Regular Updates

    Hi All,
    What is the difference between Regular Update and Batches wise updates in SQL Sever
    Thanks
    CMK...

    A single TSQL command (UPDATE, DELETE, INSERT, SELECT) can operate on multiple rows. It is more efficient to change multiple rows (set of rows) than to change just one row. Performance is much better. But, if you change too many rows within a single command,
    you may experience negative effects, such as lock escalation, more blocking, transaction log growth, huge transactions that take ages to rollback (and that means longer failover).
    So, you need to find a "sweet spot", number of rows that gives you better performance but not so large to avoid those negative effects. In practice, that would mean limiting the number of processed rows in a single command to e.g. 400 to 4000 rows.
    ROWCOUNT option is obsolete. Limit the number of rows with a TOP clause.

  • 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

  • Insert/Update/Delete Non-PO Invoice Line Item via FM/BAPI?

    Does anyone know of a way to insert/update/delete an Invoice Line item (Non-PO Accounting Invoice - Transaction FB60 or FV60) using a BAPI or Function Module (or set of function modules) using ABAP? I have been trying to find some code to accomplish this and am stuck on a couple of issues.
    I have found PRELIMINARY_POSTING_FB01 and PP_CHANGE_DOCUMENT_ENJ but both seem to submit the details to background processes. This is an issue because it gives the user a success message after execution but later delivers the error to Workflow. This is for an interfacing program so the results should be as real time as possible.
    Has anyone accomplished this via FM or BAPI and if so would you mind sharing your experiences?
    Thank you very much,
    Andy

    SG- Thank you for the reply.
    I have been playing with BAPI_INCOMINGINVOICE_PARK and I'm not sure if it is doing exactly what we want, but it is something that I have considered in the past. I plan on looking into BAPI_ACC_INVOICE_RECEIPT_POST this morning, hopefully that will provide some more for us.
    If possible I'd like to avoid BDC sessions because this program could hypothetically interface with multiple SAP systems with different configurations.
    I will check into those FM's and thank you very much.

  • IPHONE 4 – UPDATE ISSUE – IOS 7 UPDATE DELETED ALL THE CONTACTS : PLEASE HELP! PLEASE HELP!

    Hello Everyone,
    Following are the seemingly essential details in regards to this discussion :
    iPhone Model = 4
    Purchase Date = 05.Jan.2011
    Initial Activation Remark = I used my gmail email account to add contacts initially. But phone always failed to sync (back) with gmail after the initial setup. As in if I make any changes in the iPhone’s Contact List, it won’t automatically be saved to my gmail account. But I thought to keep a full phone back up on my MacBook Pro will be safer option as well.
    Latest Full Phone Backup Date = 19.Sep.2013 [via iTunes-11 on MacBook Pro-OS X 10.8.2]
    iOS 7 Update Date = 20.Sep.2013
    >>>[It went "On" Automatically when I touched to read the details, and could not stop once it got initiated - Actually I wanted to wait until some reviews were out. ****.]
    Problem = iOS 7 update deleted all the Contacts that were originally saved on the iPhone.
    Tried & Failed = I tried to restore from the available 19.Sep.2013 backup from my MacBook Pro. It restored everything but still NO CONTACTS. If I add email [orginal gmail] account's contacts then it does not show the contacts that I saved on the phone locally; around 1100.
    I am in the great trouble because my 1100+ contact list just zeroed by this new update.
    [Also, my iCloud all got screwed up. I had earlier used my wife's credit card to register for iTunes, and now my account got her name all over it. There is no option to change the name on icloud.com. I will start a new discussion for this problem.] Though I am trying not to lash out on Apple (for now), but I think that it is seriously getting into my nerves.
    Could anyone please help me to get my contacts back? I will be eternally grateful.
    I still got the Full iPhone Backup on my MacBook Pro that I did just before the update.
    Please help. Thank you!

    Yes, I did.
    It restored everything [incl. photos] but phone contacts.
    And, after restoration the iOS was still 7.
    I tried twice but still no phone contacts.
    Please help me to get my phone contacts back!

  • IPHONE 4 – UPDATE ISSUE – IOS 7 UPDATE DELETED ALL THE CONTACTS : PLEASE HELP!

    Hello Everyone,
    Following are the seemingly essential details in regards to this discussion :
    iPhone Model = 4
    Purchase Date = 06.Jan.2011
    Initial Activation Remark = I used my gmail email account to add contacts initially. But phone always failed to sync (back) with gmail after the initial setup. As in if I make any changes in the iPhone’s Contact List, it won’t automatically be saved to my gmail account. But I thought to keep a full phone back up on my MacBook Pro will be safer option as well. 
    Latest Full Phone Backup Date = 19.Sep.2013 [via iTunes-11 on MacBook Pro-OS X 10.8.2]
    iOS 7 Update Date = 20.Sep.2013 [It went "On" Automatically when I touched to read the details, and could not stop once it got initiated - Actually I wanted to wait until some reviews were out. ****.]
    Problem = iOS 7 update deleted all the Contacts that were originally saved on the iPhone.
    Tried & Failed = I tried to restore from the available 19.Sep.2013 backup from my MacBook Pro. It restored everything but still NO CONTACTS. If I add email [orginal gmail] account's contacts then it does not show the contacts that I saved on the phone locally; around 1100.
    I am in the great trouble because my 2600+ contact list just zeroed by this new update. [Also, my iCloud all got screwed up. I had earlier used my wife's credit card to register for iTunes, and now my account got her name all over it. There is no option to change the name on icloud.com. I will start a new discussion for this problem.] Though I am trying not to lash out on Apple (for now), but I think that it is seriously getting into my nerves.
    Could anyone please help me to get my contacts back? I will be eternally grateful. 
    I still got the Full iPhone Backup on my MacBook Pro that I did just before the update.
    Please help. Thank you!

    Yes, I did.
    It restored everything [incl. photos] but phone contacts.
    And, after restoration the iOS was still 7.
    I tried twice but still no phone contacts.
    Please help me to get my phone contacts back!

  • How to find out who made inserts/updates/deletes made to a SQL Table

    I want to know WHO MAKES INSERTS/UPDATES/DELETES TO a particular SQL Table. Bascially I want to AUDIT ANY Edites made to a SQL 2008 TABLE. I need info such as WHO AMDE THE Updates i.e. the user first/lastname, When update was made, what row was updated etc...How
    can I do that with SQL 2008?

    One way to achieve that would be to use triggers to detect when a change is made to the table, and then insert a record into another table/database detailing what changed and who by.
    You'd need three triggers, one for insert, update and delete respectively, and for each of those you use the "inserted" and "deleted" tables (system tables maintained by SQL) to retrieve what has been done. To retrieve who made the change you can query IDENT_CURRENT
    which returns the last identity value for a specific table.
    See :
    Triggers -
    http://msdn.microsoft.com/en-gb/library/ms189799(v=sql.100).aspx
    Inserted & deleted tables -
    http://technet.microsoft.com/en-us/library/ms191300(v=sql.100).aspx
    INDENT_CURRENT -
    http://technet.microsoft.com/en-us/library/ms175098(v=sql.100).aspx
    There may be better / more up to date ways to do this, but I've used this method successfully in the past, albeit a long time ago (on a SQL 2000 box I think!).

  • 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.

  • 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.

Maybe you are looking for

  • Memory on a nokia 6234

    Could someone give me some advice on the memory on nokia 6234 as my phone does not have much memory on ot even though i have saved everything to the memory card which is less than half full???

  • Problem in Invoice correction Req. (supplimentary invoice) - urgent

    Dear friends, When i create invoice request (RK), I am getting two line item in order. One is related to G2N item category and another one is L2N item category. G2N is showing -value and L2n is showing +value. Here my query is, I had invoice request

  • Yosemite and iOS iMessage Syncing Problem

    I am SO frustrated. I've read forum after forum and CANNOT seem to set up text message forwarding. I've signed into just one apple id across all of the devices (@icloud.com), I've selected receive from and only had my email address selected. I've tog

  • Setting icon to dialog

    Hi all, Can we able to set icon in the title bar of the JDialog? Waiting for replies...........

  • TableView scrolling even when scroll bar is in the middle

    All If we have a table that has events being inserted into it constantly when I move the scrollbar half way down the table keeps scrolling so I can't fix it on a certain row that I want to look at.