You can translate the question and the replies:

return the total results in REST webservice response

Hi, How can I return the results count in a REST webservice I am publishing in Denodo , (the total number of rows for a query)? I need to add a colomn where I will set the total of results, I tried to add new field and set the expression to count(*) but it doesnt work I get the error "invalide parameter type for function count()"* I am looking for better way to do it than adding $count to the url and have to do the call twice , first to get th results and a second time to get the count. Thank You in advance Regards
user
08-11-2021 09:46:48 -0500
code

1 Answer

Hi, I would add a field to the view with the field expression `COUNT(*) OVER (PARTITION BY NULL)` The [count](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/functions/analytic_functions/analytic_functions#count) function must be [delegated to a database](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/functions/analytic_functions/analytic_functions#workaround-to-execute-analytic-functions), so if your view isn’t on top of a JDBC data source, I would cache the underlying view so that the function can be pushed down to cache. Hope this helps!
Denodo Team
08-11-2021 16:20:33 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here