Retreiving records from a SQL database
I am trying to verify that the correct information is being stored into my SQL database. The problem I have is that I am storing some values in local variables inside my Winrunner script. How can I refer to these variables inside my SQL query in order to retreive the correct info from the database:
Here is an example:
# local Winrunner variable
appid = 0
# SQL query
"select * from sometable where app_id = appid
I want the app_id in my query to equal the appid from my winrunner script, but am having a hard time figuring out how to do this.
I will be using this query in a custom database check so I think that I might have to store the variable somewhere else, but I am not sure.
Thanks in advance for any help.
Re: Retreiving records from a SQL database
Try this for starters, using a variation on this simple statement (keeping the example short):
appid = "111";
myquery = "SELECT * from app_tbl WHERE
appid_col = " & appid;
db_execute_query("query1", myquery, rec_no);
END example. Note the syntax.
Read up on db_get_row(); to get the data.