Using Oracle 8i. I'm trying to do something like this:
open refcur for
select a.field, b.field
from DECODE(in_program, 'fpd', tablea1, tablea2) a,
where a.pk = in_param
and a.fk = b.pk;
Basically one of the tablenames needs to change based on a parameter being passed to the stored procedure. I could use IF..THEN syntax to open the reference cursor but I'll have 8 different possiblities so I'm trying to come up with something cleaner.