I am trying to declare a cursor for non-select statement like this:
Declare cur as CURSOR FOR
I know that syntactically we can use only 'SELECT' statements while declaring a cursor. but I have a stored procedure which returns a result set and I want to declare a cursor for that. Is there any way that we can do this?
But I need to access the result set and store the values of certain columns in local variables. And for that purpose CURSOR is the way which I know that could serve the purpose.
I'm not sure how to access the result set from a Sproc and store the values in local variables.
Thank you for your input.