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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Recover value of sequence in customSQL : insert ..

    Posted 09/20/12 10:54 AM

    Hello,

    I have this customSQL : insert into ADERTRANSCO values (?,?,SEQUENCE1.nextval) and i want to recover the value of the oracle sequence in the output file.

    How do i procced ?

    Thank


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


  • 2.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/20/12 06:47 PM

    How I’ve done this in the past:

    • Call select service to get SEQUENCE1.nextval
    • Call insert service, setting the appropriate field with the value retrieved

    That way you have the value to use for other purposes.


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


  • 3.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/21/12 11:19 AM

    Thank for your reply, but i don’t want to do this in 2 adapters service but only in 1.

    I want to user the returning clause the SQL insert :

    RETURNING expr [, expr ]…INTO data_item [, data_item ]…

    like this

    inert into tab(a,b) values (‘xxx’,seq.nextval) returning(seq.currval) into yyy


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


  • 4.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/21/12 08:39 PM

    I know that using one service is desirable. I have not found a way to do so. The 2 services approach worked just fine for me so I didn’t pursue any further. Is there an objection to doing 2 services instead of just one other than preference?

    I would think using seq.curval is risky because another thread may update it between your nextval and curval calls.

    Perhaps you can reference the column that is populated with the seq value in the returning clause. But I’m not even certain the JDBC adapter service (insert or custom) supports the returning clause. Perhaps it does and that will do the trick for you.


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


  • 5.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/25/12 05:44 AM

    u can have a procedure which takes in the input does an insert and gives the sequence as the output.


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


  • 6.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/25/12 09:09 AM

    What do you mean by ‘procedure’ ?

    A pl/sql procedue ? If you mean’s flow service, i don’t know how to do put the sequence value in the output.

    To reamon : i’m agree whith you : it’s not possible to using the returning clause of insert wtih a JDBC Adapter.


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


  • 7.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/25/12 09:15 AM

    have a db personnel create a procedure, create an adapter service “procedure with signature” and select the procedure from the dropdown. It will automatically give u the list of inputs and the outputs (seq no in our case).


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


  • 8.  RE: Recover value of sequence in customSQL : insert ..

    Posted 09/25/12 03:12 PM

    thanks pilaire,
    with solution is OK.

    But I need to have a list of data in my input in addition to have the sequence in the output.

    as TYPE G_TT_lg_CDMONTANT IS TABLE OF varchar2(100) INDEX BY BINARY_INTEGER;

    i’m don’t see them.


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