You can translate the question and the replies:

input parameter at run time

Hi , I want one input parameter field to be provided at the run time of a base view . I'm using this query in create from base view option in data source tab. select * from edl_cs_space_plan_analysis.v_lab_building_floor_space_org_alllocation where space_control_nbr = ''@test'' can someone please tell what is the correct way to use the input parameter value at runtime.
user
29-11-2022 06:01:00 -0500
code

3 Answers

Hi, To create a base view with an input parameter, you would go to the data source, find the ‘*Create Base View*’ tab and click on ‘*Create from Query*’ and write your SQL query setting your input parameter for example, **Where <column> = @<inputvariable>**. You can refer to the [Using the Create Base View From Query Option](https://community.denodo.com/kb/en/view/document/Using%20the%20Create%20Base%20View%20From%20Query%20Option) article in the **Knowledge Base** for more information. It looks like you have the correct format of creating the SQL query, however your input variable should be surrounded by single quotes rather than double quotes if space_control_nbr is a text type. Hope this helps!
Denodo Team
29-11-2022 20:54:13 -0500
code
Hi , Thanks for answering , now im using this query with single quotes for text type . select * from edl_cs_space_plan_analysis.v_lab_building_floor_space_org_alllocation where space_control_nbr = '@test' and entered '1070673' as sample value when it prompts. But I have one more issue regarding this . Im supposed to enter a set of text values in this at runtime ('1070673','1070675','1070676'...so on) and im using IN query in the where condition at base view to enter this like: "TEST" in ('1070673','1070679','1070663','1071261'...so on) But it is taking a lot of time for execution and after 25 input values it is giving error . The backend source is impala. Can you please tell if the query is running for each input value ? or is it passing all the values in a single query at the backend ? any workarounds in the where query to pass everything at one go to the backend?
user
30-11-2022 00:08:26 -0500
Hi, It is possible to look at the query before you execute it by looking for the **Query Plan** in the *Execution Panel*. Additionally, you can look through the **Execution Trace** of the query to see how the values you passed are being sent to the source at execution time and where in the execution the query may be taking long. I would also recommend that you look at the vdp.log at <DENODO_HOME>/logs/vdp to find more information about the error. You can refer to [Querying Views](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_derived_views/querying_views/querying_views#querying-views) and [Execution Trace of a Statement](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_derived_views/querying_views/execution_trace_of_a_statement#execution-trace-of-a-statement) in the **Virtual DataPort Administration Guide** and the [Log Column Details](https://community.denodo.com/kb/en/view/document/Log%20column%20details) article in the **Knowledge Base** for more information. Hope this helps!
Denodo Team
30-11-2022 21:12:31 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here