To automate VQL statements generated from the above queries, I would do the following steps
* Create a custom stored procedure with a string parameter to execute DDL command for automating the creation of the base views.
* To execute the DDL command you can use [executeVqlCommand](https://community.denodo.com/docs/html/browse/7.0/vdp/javadoc/com/denodo/vdb/engine/storedprocedure/DatabaseEnvironment.html#executeVqlCommand-java.lang.String-) because you cannot use the regular ExcuteQuery to run DDL command.
* I have seen that [Denodo 4E plugin](https://community.denodo.com/docs/html/browse/7.0/denodo4e/index) helps developers to easily create, deploy and more importantly, debug the custom extensions for the Denodo Platform.
* Then, deploy in the custom stored procedure in the Virtual Dataport. For creating a custom stored procedure, you can have a look at section [Developing Stored Procedures](https://community.denodo.com/docs/html/browse/7.0/vdp/developer/developing_extensions/developing_stored_procedures/developing_stored_procedures) of the Virtual DataPort Developer Guide.
* After creating a Stored procedure, create a base view on top of the Stored procedure with interpolation variable.
* Create a VDP job in Denodo Scheduler.
* In Extraction section, call the base view in parameterized query with parameter
> SELECT * FROM <BASEVIEW_NAME> WHERE <interpolation _variable> = @<parameter>
And pass the select statement in the query (non-parameterized).
* if you execute that job, it will automatically create the base view in Virtual Dataport.
For more information, you can refer to the Tutoria[l How to implement a Stored Procedure](https://community.denodo.com/tutorials/browse/customcomponents/3storedprocedure).
Hope this helps!