You can translate the question and the replies:

Query for multiple views and record count

Hi team, I need the record count for multiple views. How can i do it in a single query?? Select count(1) From View1; Select count(1) From View2; Select count(1) From View3; Select count(1) From View4; Thanks!
user
20-01-2022 20:23:02 -0500
code

1 Answer

Hi, In order to obtain the list of all views along with their row count, you could follow the below steps in the Virtual DataPort Administration Tool: * Create a JDBC(Denodo) datasource and choose the database adapter: Denodo Virtual DataPort 8.0. Provide your Denodo server configuration details and perform a TEST connection. * Under the Denodo Datasource, create a base view using the “[Create from query](https://community.denodo.com/kb/en/view/document/Using%20the%20Create%20Base%20View%20From%20Query%20Option)” option and specify the query with the interpolation variable for database name and view name. * select count(*) from @database_name.@view_name * Create a separate view from the VQL Shell over the Pre-Defined Stored Procedure GET_VIEWS: * Create view <View_Name> as select * from GET_VIEWS() * Create a [Join view](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_derived_views/creating_join_views/creating_join_views) for the above two views. The join will be on the fields database_name, view_name from GET_VIEWS() and database(interpolation variable name), view(interpolation variable name). Execute the view for desired results. Also, if you wish to have the row count of the views for a particular database you could specify the database name under the [Where Clause](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/queries_select_statement/where_clause/where_clause) of the join view. Hope this helps!
Denodo Team
21-01-2022 06:11:21 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here