Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

db_execute_query can my second param be a stored proc execute call

Status
Not open for further replies.

mickyotool

Programmer
Feb 19, 2004
2
US
From my winrunner script I want i to insert test info into a sql server table. i would like to accomplish by executing a stored proc. The script would look like this:

auto sql;
sql = "exec pi_Start_Test test_type, test_envir";
strconn = conn_string(); go get the connection info
db_connect(atfdbs, strconn); get the db session
sqlresult = db_execute_query(atfdbs, sql,1);

the error i get is this:"argument passed to Arg#2 in db_execute_query() must be variable or array element.

Am I attempting the impossible here?
Appreciate any help regarding this issue.
 
Hi mickyotool,
This error will occur if the last parameter in the db_execute_query is a number instead of a variable. The following example shows the correct syntax.

EXAMPLE:
static str1="select * from flights";
db_execute_query("query1", str1, record_number);


The third parameter to the db_execute_query function, ARG#2, cannot be a constant.

Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top