5 Replies Latest reply on Nov 20, 2014 8:11 AM by gadeyne.bram

    passing where clause in virtual view as parameter in virtual procedure

    gadeyne.bram Master



      This might be an odd use case but I'm wondering if Teiid has some functionality that I'm not aware of to solve this.


      I have a table with some time values (e.g. temperatures) and I'd like to convert these to time periods. Therefore in my result set I'd like to see the timestamp and the value and the previous timestamp and the value.


      I think that the most efficient way to solve this is using a cursor in a virtual procedure that loops over a ordered select statement.


      This far everything is fine.


      Some libraries that I'm using in my application require me to only use select statements. Since they map the columns and from clauses to RDF. Therefore I can not call procedures and pass parameters to them. So I created a virtual view that calls this procedure. For my application it looks like calling a table.


      Is there a way to tell Teiid that some ot the where conditions in this view should be passed as parameters to the procedure?


      E.g. If I only want the temperatues for a given patient then now the procedure generates all the time series. The view then eliminates the timeseries for the other patients and returns the result.


      Please let me know your thoughts on this.