webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Batch Insert Adapter Output

  • 1.  Batch Insert Adapter Output

    Posted Fri August 14, 2015 08:33 AM

    Hi,

    I have used Batch Insert Adapter with output field as rows. I face issues while inserting records into DB. I get the number of inserted rows as -2.

    Can anyone suggest a solution.


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 2.  RE: Batch Insert Adapter Output

    Posted Sat August 15, 2015 05:47 AM

    I assume you are on version 9 and above. Even I have encountered this behavior during some of my training’s. But you will not face any issue while inserting batch data in db.

    I guess there should be some fix level for this. What is your current fix level of JDBC adapter?


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 3.  RE: Batch Insert Adapter Output

    Posted Mon August 17, 2015 08:07 AM

    Hi Mahesh,

    Yes, i’m using webMethods version 9.0.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 4.  RE: Batch Insert Adapter Output

    Posted Mon August 17, 2015 11:55 AM

    Hi,

    What is your current fix level of JDBC adapter specific?

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 5.  RE: Batch Insert Adapter Output

    Posted Mon August 17, 2015 12:22 PM

    My question was not fully answered :slight_smile:

    I have analysed and found this behaviour is normal and as per the design. Have a look at the below link: and look for Update Counts in the Oracle Implementation of Standard Batching

    It says

    “For a prepared statement batch, it is not possible to know the number of rows affected in the database by each individual statement in the batch. Therefore, all array elements have a value of -2. According to the JDBC 2.0 specification, a value of -2 indicates that the operation was successful but the number of rows affected is unknown.”

    http://docs.oracle.com/cd/E11882_01/java.112/e16548/oraperf.htm#JJDBC28757


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Batch Insert Adapter Output

    Posted Sun November 01, 2015 02:22 AM

    You can get the size of the count list (variable) and this will tell you the number of rows inserted via batch insert adapter service.


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 7.  RE: Batch Insert Adapter Output

    Posted Mon August 01, 2016 08:18 AM

    If we are getting Reult Count -2 in every -Ngv Case.

    Since exact count of update is needed. So i have decided to write a Java code service for batch update and found that this is limitatin of oracle and it does not support of getting the count in case of batch update using " Prepared statement interface". So i getthe Idea that SAG has implemented JDBC Bactch update Adapter serice using “Prepared statement interface”.


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 8.  RE: Batch Insert Adapter Output

    Posted Mon August 01, 2016 04:53 PM

    Did you check to get the size of the count list (variable) and this will tell you the number of rows updated via batch update adapter service.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 9.  RE: Batch Insert Adapter Output

    Posted Fri August 05, 2016 04:25 AM

    If you batch operation, you will result with an array and “-2” if success. Just count this array by looping and checking value as “-2” which gives you what you need.

    Thanks,


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: Batch Insert Adapter Output

    Posted Fri August 05, 2016 11:31 AM

    What is the result output type you have selected Integer or string in this case of the batch insert AS?

    HTH,
    RMG


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods