Forum Discussion
Look at the TC examples here: http://support.smartbear.com/viewarticle/56911/
Using the ADO object works fine for me. In the exxample below I pass in a SQL query. I have another function that builds SQL queries for me to pass into this..
function query (sqlQuery) {
var dbObj = ADO.CreateADOQuery();
dbObj.ConnectionString = //your connection string here
dbObj.SQL = sqlQuery;
dbObj.Open();
queryResult = dbObj;
return queryResult;
}
I tried the same code as stated:
var Qry1;
// Create a query
Qry1 = ADO.CreateADOQuery();
// Specify the connection string
Qry1.ConnectionString = "Driver={Microsoft ODBC for Oracle};Dbq= FILCODU2.uk.fid-intl.com:1701/FILCODU2;Uid=xx;Pwd=xx;"
// Specify the SQL expression
Qry1.SQL = "Select * FROM table WHERE COMM_CODE = 'COT'";
// Execute the query
Qry1.Open();
// Process results and insert data into the test log
Qry1.First();
while (!Qry1.EOF) {
Log.Message(Qry1.FieldByName("columnname").Value);
Qry1.Next();
}
// Closes the query
Qry1.Close();
Related Content
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago