Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

DBTool/Database datasource using environment variables

Options
needhelp
needhelp Posts: 11

Hi,
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.

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,230 ✭✭✭
    Options

    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}..

  • needhelp
    needhelp Posts: 11
    Options

    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).

  • needhelp
    needhelp Posts: 11
    Options

    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.