Run multiple queries with same parameters
610899Feb 29 2008 — edited Feb 29 2008Hi All,
I was wonderin if there is some way to ease the effort for running multiple queries with same parameters.
The scenario is that in the development environment, when testing some module or some functionality of the application we need to check multiple tables against some common field. Lets say we have a field 'Employee'. During the development of the application I will be running multiple queries like
"SELECT 'Y' FROM TABLE1 WHERE EMPLOYEE = '101131' ";
"SELECT 'Y' FROM TABLE2 WHERE EMPLOYEE = '101131' "
"SELECT 'Y' FROM TABLE3 WHERE EMPLOYEE = '101131' "
"SELECT 'Y' FROM TABLE4 WHERE EMPLOYEE = '101131' "
"SELECT 'Y' FROM TABLE5 WHERE EMPLOYEE = '101131' "
"SELECT 'Y' FROM TABLE6 WHERE EMPLOYEE = '101131' ".
This is just a scenario(in actual all the queries will be different and complex).
All this is done using the editor 'Toad' . The pain is that for each query I have to provide the value for the field 'Employee' separately. Now if I want to test it for some different employee, I will have to do a replace for all the '101131'.
Is there some way, where I can define the values for these fields in the beginning so that all the subsequent queries take the already defined varibles.
Please let me know if there is some solution to it.
Regards,
AJ