IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.


#TechXchangePresenter
 View Only
  • 1.  Inserted recored ID

    Posted Tue August 31, 2010 11:02 AM

    Hi.

    I am using a JDBC Insert adapter.

    It adds rows to a table where an ID field ( the only PK) is generated by the table, it is not passed as input to the adapter.

    Is there a way for the adapter to return the ID generated for the inserted row?

    :confused:


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


  • 2.  RE: Inserted recored ID

    Posted Tue August 31, 2010 04:38 PM

    Guess, its not workable in same insert call :frowning: lets see if someone else has any ideas.


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


  • 3.  RE: Inserted recored ID

    Posted Wed September 01, 2010 09:11 PM

    Hello

    Soon after the insert sql(or anywhere before you do another insertion)you can use ‘Select Identitiy’ in your SQL to retrieve the last inserted identity key.
    I guess this is same as doing it in the same SQL(if its at all possible)

    thanks
    Anil


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


  • 4.  RE: Inserted recored ID

    Posted Thu September 02, 2010 12:21 AM

    What database are you using?

    DB2 provides a SELECT FROM INSERT construct that does what you’re looking for.

    Oracle has PL/SQL that could be used in a stored proc that can use INSERT…RETURNING construct. Then your service could call that proc.

    Other DBs may have similar facilities.

    The risk with the IDENTITY feature is that is probably not safe in an environment using concurrent inserts.


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


  • 5.  RE: Inserted recored ID

    Posted Sat September 04, 2010 10:18 AM

    Is it a SEQUENCE NUMBER generated by database?

    If so you can use SEQUENCE_NUMBER attribute… to get current value of inserted row…

    –Shaik


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