Forum Discussion
- mcbaneContributor
If you're wanting the same thing I needed--YES!
In JavaScript, I have variables setup as generic SQL queries. For example, to run a query against a specific account, I use a text variable with a value like:
select *
from table
where account = 12345670
Before I execute the query, I run a replace command to set it to the actual account I need for that particular run:
Query = ProjectSuite.Variables.SQLQueryVariable.replace(new RegExp("12345670","g"),"8675309");
RecSet = AConnection.Execute_(Query);TestComplete replaces 12345670 with the account number I need, and then executes the query.
I hope this helps!
Tommy
- sonya_mSmartBear Alumni (Retired)
Thanks everyone for trying to help!
tuanvinh1008 did you manage to solve this? Looks like mcbane has an idea of what could work.
- vinniewStaff
Hi tuanvinh1008
In TestComplete, I dont think you can modify the query at run time.
Happy to get another members response on that as I am not 100% certain.
If needed, you could perhaps import dB libraries and maybe import a script to do this.
However, the query should still work no?
I mean your not creating new tables or columns every time you run a test or are you?
KR
Vinnie
- tuanvinh1008Contributor
vinniew Thanks for your reply
Related Content
- 10 years ago
- 2 years ago
- 4 years ago
Recent Discussions
- 9 hours ago
- 7 days ago
- 10 days ago