Hello all!
I have a process that I'm creating that makes use of dynamic SQL (format 4). Part of my process requires that I open a handful of SQL cursors at the same time, but I won't know how many cursors to open until run-time. This would require an array of cursors, but I have been unsuccessful in doing so. I have the following line of code...
Is it possible to do something like this...
... or even this...
Or, is there a way to use the same cursor to create multiple result sets without losing any of the previous result sets?
If this is not possible, please let me know and I will explore other methods.
Thank you for your consideration!
He who has knowledge spares his words, and a man of understanding is of a calm spirit. Even a fool is counted wise when he holds his peace; when he shuts his lips, he is considered perceptive. - King Solomon
I have a process that I'm creating that makes use of dynamic SQL (format 4). Part of my process requires that I open a handful of SQL cursors at the same time, but I won't know how many cursors to open until run-time. This would require an array of cursors, but I have been unsuccessful in doing so. I have the following line of code...
Code:
DECLARE sql_curs DYNAMIC CURSOR FOR SQL_DSA[ll_counter];
Code:
DECLARE sql_curs[ll_counter] DYNAMIC CURSOR FOR SQL_DSA[ll_counter];
Code:
DECLARE sql_curs + "_" + ll_counter DYNAMIC CURSOR FOR SQL_DSA[ll_counter];
Or, is there a way to use the same cursor to create multiple result sets without losing any of the previous result sets?
If this is not possible, please let me know and I will explore other methods.
Thank you for your consideration!
He who has knowledge spares his words, and a man of understanding is of a calm spirit. Even a fool is counted wise when he holds his peace; when he shuts his lips, he is considered perceptive. - King Solomon