You can translate the question and the replies:

ITPilot wraper input query with multiple values

Hi! I have created a wrapper with itPilot in order to get delivery details. The web page has dynamic inputs (from 1 to 4) where you can put 4 codes and send a request for this 4 code details. If I had an input query, for example, "select productId from products" and my wrapper input is productId1, productId2, productId3 and productId4, the scheduler query always works with productId1. How can I do in order to fill all parameters from only 1 ddbb column? Thank you!
user
16-05-2018 10:05:08 -0400

3 Answers

Hi, I recommend you to use a parameterized query in the extraction section of the Scheduler job, so you can use the products as input. To add values to the input of the parameterized query you can select a VDP source. Here, you can execute the VDP query for obtaining values for those inputs. As you will see in this source, you could configure the mapping between the input fields and the query parameters. I'd recommend you to read how to configure [the extraction section](https://community.denodo.com/docs/html/browse/6.0/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/vdp_extraction_section) of a Scheduler job. Hope this helps!
Denodo Team
18-05-2018 08:27:52 -0400
Hi! I think VDP not solve my problem. As I can see in the extraction section, you can configure parametrized query from VDP source but my problem continue. I'll try to expose with more detail: I have 10 products( product1, product2...product10) and I like to get the details with my wrapper, and the input is on ddbb (vdp or relational data base). I can configure an example query like : select productId from products where productId = @ productId. After this, I will have 10 querys as input of my wrapper: select productId from products where productId = product1 select productId from products where productId = product2 select productId from products where productId = product3 ..... select productId from products where productId = product10 so, I have 10 iterations of my wrapper but If my wrapper has 5 inputs for products, I could obtain the same result with only 2 requests (not 10), something like this: Execution 1 : select productId from products where productId in (product1..product5) and execution 2: select productId from products where productId in (product6..product10) Is it possible? thanks!
user
21-05-2018 03:38:04 -0400
Hi, What is happening here, is that the parameterized query is being executed once for each row you get from the products view. I would suggest you to create a derived view over the products view grouping multiple product ids for each row. To get the product ids concatenated there are some functions in Virtual DataPort that will help you to achieve this such as [GROUP_CONCAT](https://community.denodo.com/docs/html/browse/6.0/vdp/vql/appendix/syntax_of_condition_functions/aggregation_functions#group-concat). Another way to group the product ids could be to [develop a stored procedure](https://community.denodo.com/docs/html/browse/6.0/vdp/developer/developing_extensions/developing_stored_procedures/developing_stored_procedures). Once you have this view created, you can execute the queries in the way you want: `select productId from products where productId in (@productIds)` Hope this helps!
Denodo Team
28-05-2018 12:10:12 -0400
You must sign in to add an answer. If you do not have an account, you can register here