8 Replies Latest reply on Mar 10, 2012 2:37 PM by Mark Addleman

    Views:  Generating the select transformation on the fly

    Mark Addleman Master

      We have a need to create views that whose query definition is generated at runtime.  For example, I want to create a view that dynamically UNIONs together tables/views found in SYS.TABLES that match a particular naming convention.  We currently have a custom execution factory that generates a query of the form "SELECT ... FROM (<unioned select statements)..." and connects back into Teiid to execute the generated query. 


      The major problem with this approach is that once we connect back into Teiid, we lose traceability on the query plan making it difficult to follow what's going on with the original query and it complicates many of our support conversations with Steven, Ramesh, etc. 


      In light of the upcoming view support in dynamic VDBs, I'd like to scrap our current approach to generating views but I don't see how the proposal would give me a programmatic hook to generate the select transformation.