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.

 View Only
  • 1.  string to SQL statement

    Posted Thu December 15, 2016 05:11 PM

    Hello Everyone,

    i have four input as string
    1.Init_SQL—this have hard code value(Select * from)
    2.Filter1
    3.Filter2
    4.Order_By

    and i want my output as a sql statement like
    (select * from xyz where(filter1value=" " and Filter2value=’ '), order_by value),
    if any value of input is null that will not be the part of the output

    Thanks


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: string to SQL statement

    Posted Thu December 15, 2016 05:36 PM

    Hi Rohit,

    As your SQL is dynamic, i suggest you prepare the SQL statement in IS service and then supply the input to “Dynamic SQL”

    To have better performance on SQL, you can have IF-ELSE-THAN (should get on google) and use this as an input to CUSTOM SQL (prepared statement).


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: string to SQL statement

    Posted Thu December 22, 2016 06:17 AM

    Hi ,
    Please do the below.

    1)use a branch step for each values and if it is not null ,then create a string for that particular filter and do a varaible susbitution like ColumnName=%filterValue%

    Repeat the step for each input and use makeString service to create AND clause.
    Then ,create where clause by using concat service .
    Then pass this string as a input to your dynamic SQL service.

    eg : select * from table ${where} . (you will pass where statement created in above steps here.

    Thanks,
    Sathya


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: string to SQL statement

    Posted Thu December 22, 2016 06:21 AM

    Adding to Satya response
    Its always a good practice to specify column names


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services