Adding query arguments (field specification)


After you have designed your query structure then you can go to the second tab to add additional field properties and arguments:

  • Sort

Generates a sort statement, valid values are asc (ascending) and desc (descending)

  • Function

Generates a function. Valid values are avg, count, max, min, sum. If you use a function then you must specify an ‘as’ synonym.

  • As

As name of a field. Especially useful when having duplicate fields or functions.

  • Group

Generates a Group-by statement

While changing arguments, the resulting SQL is modified. You can always force this by clicking the ‘refresh query’ button.


Adding query arguments (where)

The second tab is used to create the condition (where clause)


The parameter ‘:partid’ is a variable that requires to be assigned in your application.. (Zie DBQuery/DBSimpleQuery). This is bound to a cloud variable. Since version 2.3, you can also use a ? which is bound to an assignable variable. See also the considerations here.


Adding query arguments (cloud connector)

In many cases you need to drill down data. For instance if you have a list of departments and want to show a new screen with a list of employees of that department. To be able to, you need to pass the department number to the requesting application. 

To allow this kind of functionality the requesting application need to define a ‘cloud connector’. Cloud connectors are used in calling applications to assign values to that connector. In a DBGrid for instance, you can add a link and assign a database field to that connector. In fact, you describe an interface that can be used to call that application.

If you run the application stand-alone (not being called from a link) then the cloud connector is ignored. 


If you want an overview of the defined connectors, or want to create a new one without a database link (like this query) then you can go to the projects tab and use the right mouseclick to be able to select the cloud connector function.


Verifying the query

You can validate the generated query. Clicking the execute icon (lightning icon) the generated sql statement is executed. If there are :args then you will get an in-between form to apply the arguments. 

When executed, SQL errors will show, or the search result.