You can translate the question and the replies:

VQL to identify obligatory parameters/search methods via VQL

How do you determine the mandatory parameters/search methods given a view using VQL?
user
01-11-2022 05:18:02 -0400
code

1 Answer

Hi, For your scenario, I would follow the below way to identify the mandatory parameters of the view: If the mandatory parameters are configured at the source level or at the Denodo layer with an interpolation variable, I would navigate to the VQL section of the view and look for the ***“CREATE OR REPLACE TABLE”*** or ***“ALTER TABLE”*** the VQL statements. Under the **ADD SEARCHMETHOD** section, you can see the field names with the parameter type - ***OBL or OPT*** * OBL - Obligatory * OPT - Optional > > ***ADD SEARCHMETHOD ( OBL )*** For example: The view **“bv_student”** has 2 fields in which an obligatory field **“id”** which will be indicated in the VQL like below: > ***CREATE OR REPLACE TABLE bv_student > ADD SEARCHMETHOD bv_student( > CONSTRAINTS ( > ADD id (=) OBL > ADD name (=) OPT > )*** > Also, the view parameters defined in the derived views at the Denodo layer can be identified by ***“USING PARAMETERS (: type)”*** keywords in the VQL. For example, ***CREATE OR REPLACE VIEW bv_employee.... USING PARAMETERS ( employee_id: text);*** Here, the **“employee_id”** field is a view parameter which in turn is an obligatory field for this view. To get the VQL of the particular view, you can execute the below [DESC](https://community.denodo.com/docs/html/browse/latest/en/vdp/vql/describing_catalog_elements/exporting_metadata/exporting_metadata#:~:text=The-,DESC%20VQL%20DATABASE,-statement%20exports%20all) command from the VQL Shell > ***DESC VQL view *** For more information regarding the View Parameters, you can refer to [Parameters of Derived Views](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/creating_derived_views/creating_selection_views/creating_selection_views#parameters-of-derived-views) and regarding Interpolation variable, you can refer to [Creating Base Views from SQL Queries](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/creating_data_sources_and_base_views/jdbc_sources/jdbc_sources#creating-base-views-from-sql-queries:~:text=The%20query%20may%20have%20interpolation%20variables%20(see%20section%20Paths%20and%20Other%20Values%20with%20Interpolation%20Variables%2C%20which%20allow%20the%20SQL%20query%20sent%20to%20the%20database%20to%20be%20parameterized%20according%20to%20the%20specified%20query%20conditions) sections of the Virtual DataPort Administration guide. Hope this helps!!
Denodo Team
 Edited on: 02-11-2022 05:17:01 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here