You can translate the question and the replies:

Flatten query parameters (array of string)

Hello, I have a table with an ID of a company and WS for getting an information if the company can be trusted or not. The problem is with the WS. In default, it has parametrized input array of string and returns two arrays of outputs. I used FLATTEN function and flatten one of the outputs. That means that final output looks like: **Field Name:** -parameters [parameter] ID_of_a_company [int] -ID [int] -Name [str] -Reliable [bit] -Dateupdated [date] If I try flatten this already flattened view I get an error: Cannot save the view; View 'f_f_company' without search methods. If I try use this view to JOIN with the table I get an error: Cannot save the view; Multivalued field 'f_f_company'. Is there a way how to flatten the array of string input? Can I use array of string input as a JOIN argument with another table? How? Thank you for your answer and time. Pavel
07-01-2019 05:04:58 -0500

3 Answers

Hi, I faced a similar problem when passing array of string input and was able to resolve by using the ROW() constructor. For eg: `select * From <view_name> WHERE input_array_field = { ROW( 'input1', 'input2', 'ínput(n)' ) }` For more details, you can refer to section [Conditions with Compound Values]( of the Virtual DataPort VQL Guide. Hope this helps!
Denodo Team
08-01-2019 07:21:31 -0500
Hi, thank you for the answer. I was able to construct the select with array input field. In my case it looked like this: `SELECT * FROM f_getstatus WHERE parameters = { ROW( '' ), ROW( 'ID_of_the_company' )` [FIELD NAME] [FIELD TYPE] -parameters (picture here looks like a ruler) ID_of_the_company (text) -ID (text) -Name (text) -Reliable (text) -Dateupdated (localdate) Unfortunately I didn't know how to save the query as a datasource and make the input field as parameter. Is there a way how to save parametrized VQL query as a data source so I can join it with another table? `SELECT * FROM f_getstatus WHERE parameters = { ROW( '' ), ROW( '#PARAMETER_HERE#' )` In that case the parameter will be taken from id\_column in the table? Thank you
10-01-2019 12:51:16 -0500
Hi, I would use a logic like below to join the fields of an array to an another table (view) with regular columns : ``` select * From <web_Service_view> a , <table_view> a1 where (a.array_name).column1 = a1.field1 and (a.array_name).column2 = a1.field2 and (a.array_name).columnn = a1.fieldn; ``` You can create a [Derived view]( over the above join condition to expose the view for end users. Hope this helps!
Denodo Team
15-04-2019 10:47:14 -0400
You must sign in to add an answer. If you do not have an account, you can register here