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

2 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](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/queries_select_statement/where_clause/where_clause#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
You must sign in to add an answer. If you do not have an account, you can register here