You can translate the question and the replies:

Passing a list of same objects and passing a list of different objects in a select query view.

I would like to pass the following data into denodo view. Json1 = {'name': 'Kelly', 'code': 'KL'} Json2 = {'name': 'John', 'code': 'JH'} payload = [Json1, Json2] I am expecting two of Jsons to query the view. I tried putting payload into my denodo view and I get none. But if I put in Json1 data, there is value return. denodo view: Query: Select name, lastname, code, age from TABLE1; Question: Is the method above wrong if i'm parsing two json files? Else, is there any methods to pass Json1 and Json2 in 1 view query. (not inserting data into db but calling the data from the denodo view using the json1 and json2) Json3 = {'lastname': 'Kelly', 'code': 'KL'} payload2 = [Json1, Json3] Question: Can we call the denodo view select query when there is two different values (name, code) & (lastname, code) in 1 view at a time? Please share the method. Thanks.
user
14-06-2023 04:55:41 -0400
code

1 Answer

Hi, From my understanding you want to query your view and filter for the field values you have stored in your json variables. If you want to do so using the Denodo RESTful Web Service, you can see an example in the section [Input Parameters of the RESTful Web Service](https://community.denodo.com/docs/html/browse/latest/en/vdp/administration/restful_architecture/restful_web_service/input_parameters_of_the_restful_web_service#:~:text=REST%20Web%20Services-,%24filter,-Filters%20the%20rows) of the Virtual DataPort Administration Guide. Using Denodo VQL instead you can just specify a WHERE condition with the values of your JSON variables. Example: SELECT * FROM <your_view> WHERE (name = 'Kelly' AND code = 'KL') OR (lastname = 'Kelly' AND code = 'KL') The example above also demonstrates how to filter for different value pairs at a time. Note that if you want to query your view, you do not need a payload and it would be a GET request when using the RESTful Web Service. Let me know if that answers your questions!
Denodo Team
14-06-2023 06:37:47 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here