This content has been marked as final.
Show 1 reply
-
1. Re: Does teiid has ODATA support for aggregation functions. Is there any other way to pass GROUP BY {parameter} dynamically through an application request
shawkins Apr 25, 2017 10:33 AM (in response to sanjeewa111)Unfortunately broader aggregate support for odata is still pending - [TEIID-3522] Provide Data Aggregation Extension to OData V4 - JBoss Issue Tracker
Dynamically referencing a column in the group by will require the use of dynamic sql:
execute immediate 'SELECT XMLELEMENT(NAME "rows", XMLATTRIBUTES (g1Table.p1 as p1), XMLAGG(XMLELEMENT(NAME "row", XMLFOREST(ID, EMPNAME)))) AS xml_out FROM testDataSource.testTb group by ' || p1;
But you need to make sure to prevent sql injection.