X

Shay Shmeltzer's Oracle Development Tools Tips

Leveraging the Q Parameter to Filter Tables with In Clause

Shay Shmeltzer
Director of Product Management - Oracle

The business objects created by Visual Builder expose a powerful REST service interface that includes the ability to use complex query conditions to filter the list of records they return. This is done using the q parameter as described here. In the current version of Visual Builder we didn't expose a design time access to the q parameter and rather provided an abstraction through the filterCriteria approach for defining queries. This saves you from the need to learn SQL syntax for queries - and generates the q parameter for you.

But you can actually use the q parameter directly as well - passing it as one of the uri parameters when you call the GET REST method. This can be useful for example when you want a more complex query condition. For example if you want to use the SQL in clause - something like "Where name in ('joe', 'dave', 'jane')".

In the video below I show how to modify the q parameter and pass it into your ServiceDataProbvider definition so it will modify the query populating a table. I'm using a bit of JavaScript to create the needed query syntax (surrounding values with ' , and adding the SQL syntax at the start). The code I use is: 

  PageModule.prototype.createIn = function (names){
    var surrounded = '\'' + names.split(',').join('\',\'') + '\'';
    var query = 'name in ('+surrounded+')'
    var ret= {"q" : query} ;    
    return ret;     
  }

Check it out here:

 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.