You can translate the question and the replies:

Using VQL to DROP or DELETE a derived view

Is there a way to DELETE or DROP a derived view using VQL? I would like to programatically do this in python but there doesn't seem to be a VQL command (that I can find) that would allow me to have a list of views to run through and delete. Thanks!
user
14-03-2022 05:29:58 -0400
code

3 Answers

Hi, In general, the **DROP** statement could be used to **remove** a “base view” or a “derived view” of a particular Denodo Virtual Database. Below is the syntax to delete a view: `DROP VIEW <view_name>;` If the requirement is to delete the tuples of a view rather than the whole view, then the **DELETE** Statement should be executed over the corresponding view. Below is an example to delete the tuples of a view: `DELETE FROM <view_name> WHERE <condition>;` In order to spectate the list of views available in the Virtual Database, the **LIST** command could be executed in the VQL shell. Below is the syntax to list all the views or to list only the base views: `LIST VIEWS [BASE | ALL];` Alternatively, the [**pre-defined**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/stored_procedures/predefined_stored_procedures/predefined_stored_procedures) Stored Procedures like **GET_VIEWS(), GET_ELEMENTS()** could be used to retrieve all the available views with its type. For more information, you could refer to the below documentations: * [**Removing Elements from the Catalog**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/removing_elements_from_the_catalog/removing_elements_from_the_catalog) * [**DELETE Statement**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/inserts_updates_and_deletes_over_views/delete_statement/delete_statement) * [**Listing Elements in the Catalog**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/listing_elements_in_the_catalog/listing_elements_in_the_catalog) * [**GET_VIEWS**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/stored_procedures/predefined_stored_procedures/get_views) * [**GET_ELEMENTS**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/vql/stored_procedures/predefined_stored_procedures/get_elements) Hope this helps!
Denodo Team
14-03-2022 09:19:27 -0400
code
Was the view deleted from your VCS repository as well, say you are using git with that.
user
20-07-2022 11:14:56 -0400
Hi, In general, if the [**VCS**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/version_control_systems_integration/vcs_configuration/virtual_dataport_server_configuration) is configured for the Virtual DataPort server and if you delete a view via the VDP admin tool, the deleted view will be still shown in the Server Explorer (marked with a **gray** icon), although it does not exist anymore in the VDP server. So, in this moment, the view details cannot be accessed from the VDP admin tool. Additionally, when deleting a particular element, it is possible that other dependent elements associated with the removed view could also be deleted. Hence, if those elements are configured under the VCS, they will also be shown in the Server Explorer, marked with the 'gray' icon. Therefore, in order to reflect the modified changes in the "local" repository, you could perform a **Commit** operation. Also, If you wish to reflect the modified changes in the "remote" repository, you could perform a **Push** operation followed by the Commit. You could also refer to the sections [**VCS Operations for GIT**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/version_control_systems_integration/vcs_integration_features/vcs_operations_for_git) and [**Delete Operations**](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/version_control_systems_integration/vcs_integration_features/delete_operations) of Virtual DataPort Administration Guide for more information. Hope this helps!
Denodo Team
21-07-2022 02:03:29 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here