3 Replies Latest reply: Jul 22, 2014 10:35 AM by Anshul RSS

    Dynamic query using DB Adapter

    2655429

      Experts,

       

      I am using DB adapter to call a simple database query. I have selected the option of Execute Pure SQL and the query is -

       

      SELECT DEPT_NAME,EMPLOYEE FROM DEPARTMENT WHERE EMP_ID IN ( SELECT EMPID FROM EMPLOYEE WHERE (DEPT_ID=#DEPTID))

       

      When I run the query standalone on database passing the value of dept_id, it works perfect.

      Additionally when I hardcode the value of #DEPTID in db adapter, it works succesfully. But if I use the above query passing DEPTID as input from my bpel process, it returns nothing.

      Can anyone tell me where I am going wrong?

       

      Thanks