DBTool/Database datasource using environment variables
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:
- New Test
- Add 2 Environment component and Set it DEV and the other QA
- in the the DEV Environment component a variable name : DB_CONNECTION
- set the variable to "C:/DEV/myOracle.properties"
- in the the QA Environment component a variable name : DB_CONNECTION
- set the variable to "C:/QA/myOracle.properties"
- set DEV as the active one for now
- save and close all tabs.
- now add a dbtool component
- in the input field set ${DB_CONNECTION}
- enter this SQL statement in SQL : SELECT sydate from dual;
- save it and click on Refresh
- Run it
- 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
-
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}..
0 -
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).
0 -
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.
0