Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using an output value as input to a SQL statement
#1
Not Solved
Hi,

I'm hoping someone can help me. I'm wondering if it is possible to use an output value that I have stored in my test run and use it as input in a SQL statement (Database checkpoint). The output value is a parameter so it can change from run to run, hence my reason to be able to use the run's output value in the SQL query. Is there a way to do this? I have tested my connection but need to drill down and figure out how to word the query.

Any input would be appreciated! Thank you.
Big Grin
Reply
#2
Not Solved
You can pass a variable to a string then pass that string to the DB Query:
Code:
ZipCode="12345"
sqlstring= "SELECT count(*)  FROM LOCCITY WHERE  LOCCITY.LOCZIPCODESTART LIKE '"&ZipCode&"%' "

Set Rec = CreateObject("ADODB.Recordset")
SQL= ""&sqlstring&" "
Rec.open SQL ,conn

as you can see I'm just getting the count back
Reply
#3
Not Solved
When I attempt this, I get an error message:
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Line (49): "Rec.open SQL ,conn".

I copy/pasted what you wrote -
Keep in mind that I am very new to QTP. Thanks! Any response is appreciated.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to input Japanese Character through UFT Alaguraja 0 785 07-01-2020, 11:32 AM
Last Post: Alaguraja
  How to get input from the user in QTP? shanthiK 10 18,053 08-07-2017, 11:34 PM
Last Post: zunebuggy
  Exe invoked through UFT is unable to access IIS and SQL Server service bkdevise 0 1,971 08-25-2015, 05:49 PM
Last Post: bkdevise
  Output Values error Tasleem 3 3,718 10-27-2014, 02:13 PM
Last Post: Tasleem786
  parameterize Excel Sheet Name in SQL bjitsidhu 0 2,732 07-20-2014, 08:34 AM
Last Post: bjitsidhu

Forum Jump:


Users browsing this thread: 1 Guest(s)