Hi Ben,
I don't think this is possible. In my attempts to combine parameterized queries and PIVOT BY, I get an error:
When used with parameterized query, PIVOT requires an explicit values list
Is this what you're seeing as well?
Underneath, the issue is that when we resolve the list of potential PIVOT values, we don't have the full context to know the parameter values. We need to know the shape of the results outside of having the parameters, so that we can do things like render the schema browser, etc.
While it's not as elegant, could you dynamically build the SQL with the parameter values embedded in your use case?
Thanks,
Josh |
yeah, that matches what i see, and i agree w/ the reason why. in my paramterized example above, i gave them default values (null), which i why i think LabKey allows that query. I assume it evaluates the PIVOT column list using those default parameter values.
and yes, i ended up doing the less elegant solution of building SQL client-side and using executeSql to get my data.
thanks. |