I was wondering if anyone had experience using multiple cursors in stored procedures. I am currently using a sproc to return a sql statement based on metadata. I pass in 3 arrays (One for columns, one for tables, and one for 'where' clauses.)
It works pretty well, but I have to create 3 cursors as I go through the arrays and match each column to each table to each where clause. As I go through this, I assemble a sql statement.
My only question is, "Would it be better to place this logic in VB or some other language as opposed to having multiple cursors do the work on the db side? How slow/memory intensive is creating cursors and stepping through the records?"
Thanks for any advice!