Virtualize : Use Database as datasource and parameterize SQL query

bsaikrishna84bsaikrishna84 Posts: 46

We are using excel as a datasource and parameterized the responder response.
Since excel has limitations on rows , I wanted to use Database as a datasource.
But, if i use database , the query needs to be parameterized since account number i use is unique every time.
Based on the account number i need to get the rows from the database and have to parameterize the responder response using the columns that are retrieved in result set.
Can someone help on this please ?

Comments

  • williammccuskerwilliammccusker Posts: 154 ✭✭

    Hi,
    Would a db query tool work for your use case? You could chain the query tool to the incoming request and parameterize it the incoming account number. The results from the db query could be placed into a data bank for use in the responder.

  • bsaikrishna84bsaikrishna84 Posts: 46

    There is no DB Tool to use in responder. DB Tool works only when test case is created

  • williammccuskerwilliammccusker Posts: 154 ✭✭

    Hi,
    Did you check under all tools? When I tried adding a tool to the incoming request payload I had to find the DB Tool under the "All Tools" category. Or you can change the tools be sorted by category and then it is in the "Database" section. Maybe these screenshots will help.

  • bsaikrishna84bsaikrishna84 Posts: 46

    Oh yeah my bad I confused. Got it now.

    But how do i mention the variable in query.
    Do i need to add XML Databank to save the account number and then pass it to the query tool ?

    Or is there any other way to do it ?

  • williammccuskerwilliammccusker Posts: 154 ✭✭

    Hi,
    Yes chain an xml data bank before the DB Tool to extract the the variable and then reference the variable in the DB Tool. That is probably the easiest way to do it.

  • bsaikrishna84bsaikrishna84 Posts: 46

    Thanks william :)

  • williammccuskerwilliammccusker Posts: 154 ✭✭

    You're welcome :smiley:

Sign In or Register to comment.