IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  DB2 Database Table Update

    Posted 03/16/11 04:15 PM

    Originally posted by: denzer


    So we have a table level update/insert set up and the DB adapter, by default will attempt to update the record if found and insert it if not. This is just the action I need except I would like to know if an update or insert was done. Is there anyway for the adapter to pass back the action it did. I'm assuming not but thought I'd see if anyone has any good ideas on this short of doing two calls; one with update only, catch the error and do an insert only. For efficiency I'm trying to avoid the extra processing of the double call.

    Thanks
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: DB2 Database Table Update

    Posted 03/17/11 08:00 AM

    Originally posted by: TarunB


    Garrett

    Here are some ideas off the top of my head:-

    1)
    You could generate a DB trace for each call, and reading this file after every execution. The trace file will contain the word UPDATE or INSERT depending on the operation performed. Of course, you'll need to make the trace filename unique to avoid single-threading the map. And you'll need to have a separate map to process each trace file.

    2)
    Perform this update/insert via a stored procedure and have the procedure return a value depending on the action performed by the call. You can then analyse the value directly after the call from your map.

    3)
    My personal preference would be to do the 2 calls. The first would be a simple Select statement, something like "Select 1 from table where blah blah...", to check for existence of the row. And the second would be your update/insert. If you set the config up correctly, the connection will be shared and so there is no perceivable degradation of performance.
    Let us know how you get on,

    Tarun
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: DB2 Database Table Update

    Posted 03/18/11 10:08 AM

    Originally posted by: denzer


    We are using the two call route as of now with a select to see if the row already exist. It is not ideal but it is working though I'm still trying to find a way to make it more efficient by reducing wasteful IO calls.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender