How can I open a declared cursor that is a dynamically prepared select statement behind it (different number of parameters for the using clause)?
I built the open statement as a variable, now I need to 'run' it..
(i.e.: depending on the criteria entered, the where clause of the prepared select statement can have 1 to 5 variables.. Can have any combination of the 5 criteria, so if a user wants all programs, there would be no 'and program = ?' clause. The full where clause is:where fy = ? and quarter = ? and program = ? and facility = ? and agency_code = ?. But as mentioned, it could have just 'where fy = ?'
Does anyone have any ideas?
Thanks!