cstott1
9 years agoOccasional Contributor
Unable to transfer data from a data source into SQL query
I'm trying to transfer data from a data source to be used in a where statement of a SQL query. Essentially my script does the following:
- Holds “ID” numbers in a grid data source
- Executes a SOAP request and one of the fields uses the “ID” numbers from the grid data source ${DataSource#IDNumber} (have looped this at the end of the test case to go back and use the next ID number and run again)
- Uses a Microsoft SQL Server driver to connect to a DB and run a Select SQL query on one of the tables and compare this against some of the data in the SOAP request
I can do this for one “ID” number if I write it as where = '123' however I want to be able to use the ID number that was used in the test case for that loop i.e ${DataSource#IDNumber}. I have tried it writing the below but it doesn’t work can someone help please?
Select *
From OpsControl.Piece
Where OpsControl.Piece.TrackingNumber = 'DataSource#IDNumber'
Many thanks
Chris
Hi,