DBTool/Database datasource using environment variables

needhelpneedhelp Posts: 11

I am trying to set DBTool and Database using the variable name define in the Environment component but unsuccessful. Here are the steps I have tried:

  1. New Test
  2. Add 2 Environment component and Set it DEV and the other QA
  3. in the the DEV Environment component a variable name : DB_CONNECTION
  4. set the variable to "C:/DEV/myOracle.properties"
  5. in the the QA Environment component a variable name : DB_CONNECTION
  6. set the variable to "C:/QA/myOracle.properties"
  7. set DEV as the active one for now
  8. save and close all tabs.
  9. now add a dbtool component
  10. in the input field set ${DB_CONNECTION}
  11. enter this SQL statement in SQL : SELECT sydate from dual;
  12. save it and click on Refresh
  13. Run it
  14. Actual Result: DBTool is not enabled, I believe it does not support the user define variable.

Thank you for assisting me on this issue.


  • benken_parasoftbenken_parasoft Posts: 622 ✭✭✭

    Are you using the DB Tool or database data source? They behave differently, and have to be configured differently, and so I want to make sure I'm understanding you correctly.

    In fields in tool editors, ${var_name} generally works. In data source editors, you may need to use "soa_env" prefix like ${soa_env:var_name}..

  • needhelpneedhelp Posts: 11

    Hi benken_parasoft, thank you for your help, I'll give a try today.

    I do use DBTool and DB Datasource.

    For DBTool i am using the global property to share the connection properties file. unfortunately DB Datasource does not support (it would be nice, it uses the same concept).

  • needhelpneedhelp Posts: 11

    I have give a try with Datasource and it seems not working when it is a Database Datasource Type. It work if it is excel, I haven't for other type.

Sign In or Register to comment.