Hello Venkata,
ZAPTEST does not provide built-in utility to query a database.
Instead you can use the ADODB object.
This is an example for SQL Server. Please search the WEB for additional information.
‘create DB objects
Set objConnection = CreateObject(“ADODB.Connection”)
Set objRecordset = CreateObject(“ADODB.Recordset”)
‘This connection uses local windows authenticated user
objConnection.Open “DRIVER={SQL Server};Server=ZAPDEMOSQL54SQL2020;Database=OLDB;Trusted_Connection=yes;”
‘This connection uses SQL authentication
‘objConnection.Open “Provider=SQLOLEDB;Data Source=ZAPDEMOSQL54SQL2020;Database=OLDB;User ID=’‘;Password=’‘;”
‘run query
ContextId = 123456
Dbquery=”SELECT TOP 1 ID FROM [Transaction] NOLOCK WHERE ContextId ='”& ContextId &”‘ ORDER BY 1 DESC”
objRecordset.Open Dbquery,objConnection
TransactionID = objRecordset.fields(“ID”)
objRecordset.Close
objConnection.Close
set objRecordset=nothing
set objConnection=nothing