Dedicated to bringing you the best information on successfully starting, marketing and running a business online and off.

Can I use Dynamic SQL statement with cursor

Dear Gurus,

I have two tables tab_mstr and tab_hist.
I want to transfer data from tab_mstr to tab_hist table after some
manipulation.
but query for cursor is taking some parameter from IN
parameter. .i.e. need of creating dynamic SP
source code :
....
....

DECLARE TrialCursor CURSOR FOR CONCAT('SELECT *
FROM',tab_name,'where deptno=10';

....
....

Can I create cursor using dynamic query.
If not possible Is there any other option for that?

Thanking in advance