This is the usual way a cursor is declared:
DECLARE cursor_name
FOR select_statement ...
Is there a way to use a string variable in place of the select_statement?
In other words, my SQL statement depends upon parameters that are entered when my Stored Procedure is called. I want to be able to run the Cursor with the SQL string that is created using those parameters. Thanks in advance.
DECLARE cursor_name
FOR select_statement ...
Is there a way to use a string variable in place of the select_statement?
In other words, my SQL statement depends upon parameters that are entered when my Stored Procedure is called. I want to be able to run the Cursor with the SQL string that is created using those parameters. Thanks in advance.