Forum Discussion
Colin_McCrae
12 years agoCommunity Hero
I use parameterised SQL DB queries in my tests all the time.
But mine are all scripts.
If you are able to use script units, Tanya's link contains all the info you need. I'm using an ADO connection and have a central script function which does all my queries.
What I don't like so much is the database record(s) object it returns. I find that very cumbersome to work with. I normally end up dumping the results into a string array and working with that instead as I find it's actually easier.
Worth a look even if you don't normally script. You obviously already know the SQL queries, so you just need to work out the connection string to use and then a few commands around interacting with the DB. Not that tough if you already have a reasonable understanding of how DB's work in the first place ...
But mine are all scripts.
If you are able to use script units, Tanya's link contains all the info you need. I'm using an ADO connection and have a central script function which does all my queries.
What I don't like so much is the database record(s) object it returns. I find that very cumbersome to work with. I normally end up dumping the results into a string array and working with that instead as I find it's actually easier.
Worth a look even if you don't normally script. You obviously already know the SQL queries, so you just need to work out the connection string to use and then a few commands around interacting with the DB. Not that tough if you already have a reasonable understanding of how DB's work in the first place ...