Du kan bruge DBMS_XMLGEN
for at lave dynamiske sqls inde i en forespørgsel:
select *
from table1 as t1
where dbms_xmlgen.getxmltype('select * from ' ||
t1.table2name ||
' where datetocheck > add_months(sysdate, -6)
').extract('//text()').getstringval() is not null