How to Pass variable in the sql query when creating DB Checkpoint

How can we pass a variable while creating a DB checkpoint. Is it even possible ?

I would like to do something like

QTP script
variablename=somevalue

DB Checkpoint query:
select * from table where col=variablename

instead of doing
select * from table where col=123

Thank you
Sairam

Questions by sairam100   answers by sairam100

Showing Answers 1 - 2 of 2 Answers

amninder

  • Apr 25th, 2008
 

Set con=createobject("ADODB.Connection")
con.connectionstring="DSN=QT_Flight32;DBQ=C:Program FilesMercury InteractiveQuickTest Professionalsamplesflightappflight32.mdb;Driver=C:WINDOWSsystem32odbcjt32.dll;DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
con.open()
var=2
Set rcrecordset=con.execute("select * from Orders where Order_Number = " &var & "")
rcrecordset.movefirst
msgbox rcrecordset.fields(0) & rcrecordset.fields(1)
Set rcrecordset=nothing
con.close
Set con=nothing

you can also use datatable to parameterize the sql query

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions