2 Replies Latest reply: Aug 20, 2014 3:32 AM by 2655429 RSS

    Custom query conditions in db adapter

    2694603

      Hello,

       

      How to execute custom query in bpel db adapter?

      For example :

      1. select * from employee where status = 'N' and address is not null

      2. select * from empoyee where substatus = 'Y' and phone is null

       

      after where keyword - query part is dynamic, parameter combinations and count is unlimited ( depends on business logic ). It is not possible to implement each condition parameter as parameter in db adapter configuration.

      Db adatper query has to be something like  : select * from employee where #condition# , but #condtion# need to be interpretated as condition not string with quotes..

       

      best Regards,

      Uldis

        • 1. Re: Custom query conditions in db adapter
          Anshul

          Well you can try using database xpath function in assign activity and get the data instead of database adapter.

          XPath Extension Functions

           

          Regards,

          Anshul

          • 2. Re: Custom query conditions in db adapter
            2655429

            Say your complete query looks like this -

             

            select SUBJECT_NAME from RELATION

                        where PID_GID_SSID IN (select PARTY_KEY from  xref WHERE row_id='123')

             

            1). In assign activity, write out the query part which comes after where clause and assign to variable query

            (select PARTY_KEY from  xref WHERE row_id='123') , replace the value of row_id from input value in assign.

             

            2. Now open DB adapter and pass the rest of query as input -

            select SUBJECT_NAME from RELATION

                        where PID_GID_SSID IN #query