DataBase Filter Settings

The Recipe resources and the Trend and DataAnalysis objects provide some properties for applying queries, filters or sort bys on data to be extracted from the Data Base.  In this way the resulting query for extracting data can be customized when the default query is not suitable for the task at hand.  The three properties described below are available in the Recipe "Recipe Database Settings Properties" properties and in the Trend/DataAnalysis object's  "Stile" properties.

 

 

Default Filter

This edit box permits you to enter a text string containing the filter function in SQL standard language on data to be selected from the Database. The filter functions automatically by showing the WHERE suffix in a drop-down window, to allow you to simply indicate the filter parameters. For example, let's suppose a  "Temperature1" column has been defined in the database table" and we need to apply a filter for extracting records where the "Temperature1" value is more than 100 only, in this field we will have to enter:

 

Temperature1 > 100

 

This text string is static and cannot be changed in runtime.

When the object is a Recipe and  you wish to use a dynamic filter function in the database object, you will need to use the "Tag Query" which can be setup in the "Recipe Execution Properties".

 

Default Sort

This edit box allows you to enter a text string containing the sort function in SQL standard language in data to be selected from the Database.  The sort functions automatically drops down a window with the ORDER BY suffix in it, allowing you to simply indicate  the data sort parameters. For example, let's suppose a  "Temperature1" column has been defined in the database table" and we need to apply a filter for extracting records in sort by increase mode based on the "Temperature1" column, we should enter:

 

Temperature1 ASC

 

This text string is static and cannot be changed in runtime.

When the object is a Recipe and you wish to use to dynamic Sort  function in the database object, you will need to use the "Tag Query" which can be setup in the "Recipe Execution Properties".

 

Default Query

This edit box allows you to enter a text string containing the query in SQL standard language in data to be selected from the Database.

 

The text string is static and cannot be changed in runtime.

When the object is a Recipe and  you wish to use to dynamic query  function in the database object, you will need to use the "Tag Query" which can be setup in the "Recipe Execution Properties".

 

When this property is set in a Trend/DataAnalysis object, it will be necessary that all the columns to be selected for the Trend be specified correctly in the query.  For instance, let's suppose that these three "Value1", "Value2" and "Value3" columns have been defined in the DataLogger, and that they have also been selected for displaying in the Trend, the query would be customized as:

 

Select LocalCol, Value1, Value2, Value3 From DataLogger Where Value1 > 100 Order By LocalCol DESC

 

if the "Show msecs." option had been enabled in the Trend/DataAnalysis the query should then be :

 

Select LocalCol, MSecCol, Value1, Value2, Value3 From DataLogger Where Value1 > 100 Order By LocalCol DESC

 

However a query like the one shown below would result as being incorrect because it includes columns that the Trend does not have:

 

Select * From DataLogger Where Value1 > 100 Order By LocalCol DESC

 

 

See Also