I connect to SQL server and run a stored procedure to return the values I need. In this example I create a connection, call the Stored procedure, then clean up the response to a string I can use.
This is setup as a Custom keyword so I can simply call it when needed. You could add a variable for the Stored Procedure name, if you have many different call to make.
new Sql(sql).call (âSequence;â) //name of my stored proc
def res = (sql.rows(âselect WebCallSequence from WebCallSequence;â).toString())
def numb = res.substring(res.lastIndexOf(":") + 1) //cleaning the return string
def counter = (numb.substring(0, numb.length()-2)) //cleaning the return string
return counter //return the value
Hi I am wondering about this too. I set up the db user, pwd and connection url in Project Settings>Database. How do i call this global variable from within my code?
Hi I am wondering about this too. I set up the db user, pwd and connection url in Project Settings>Database. How do i call this global variable from within my code?
I connect to SQL server and run a stored procedure to return the values I need. In this example I create a connection, call the Stored procedure, then clean up the response to a string I can use.
This is setup as a Custom keyword so I can simply call it when needed. You could add a variable for the Stored Procedure name, if you have many different call to make.
new Sql(sql).call (âSequence;â) //name of my stored proc
def res = (sql.rows(âselect WebCallSequence from WebCallSequence;â).toString())
def numb = res.substring(res.lastIndexOf(â:â) + 1) //cleaning the return string
def counter = (numb.substring(0, numb.length()-2)) //cleaning the return string
return counter //return the value
}
Hello Mark,
I want to execute Stored Procedure by passing parameter value in it. How to execute in above script? Database checkpoint with such stored procedure not working for me.