SQL queries on tables

From RadiWiki
Revision as of 13:26, 4 June 2007 by Joro (talk | contribs)
Jump to navigation Jump to search

The report generator of RadiMation supports the usage of SQL Queries on tables that are provided by the report generator. This makes it possible to include a customized table in the final report.

In combination with the 'SQL' queries, more advanced tables can be created like:

  • Changing the order of the columns in the table
  • Hiding selected columns from the table
  • Change the sorting of the rows, based on a specific column
  • Filtering of the rows, based on the data that is included

The most simple SQL statement is:

SELECT * FROM <TABLE>

Where '<TABLE>' is an existing report generator code that includes a table in the report. This simple SQL statement can be extended with:

  • An optional 'WHERE' clause can be included that defines an additional filter that should be used on the rows.
  • An optional 'ORDER BY' clause can be included that specifies any specific ordering of the rows.
  • The names of the columns that can be used in the SQL queries is the same as they appear in the table itself. Any column names that include a space, should be included in '[ ]'

Examples[edit]

Only the frequencies above 50 MHz will be included:

||SELECT * FROM AD CHANNEL 4,3,2,1 LIST WHERE Frequency  > 50E6||

Only the frequencies between 1 Hz and 20 MHz will be included, where the AD-channel was measured out of the specified range ('TABLE'), and the tables is reverse-sorted on the frequency column.

||SELECT *  FROM AD CHANNEL 8,7,6,5,4,3,2,1 TABLE WHERE FREQUENCY >= 1 and FREQUENCY <= 20E6 order by Frequency desc||

Include the 'EQUIPMENT TABLE' including all the columns (also the hidden columns)

||SELECT ALL FROM EQUIPMENT TABLE||

Internally the SQL statements and the table data itself, are passed through the SQLite database engine. Because the SQLite database engine is used, almost all variations of the SQL queries are supported. The SQLite database engine is included in the setup program of RadiMation, and will always be installed.

Information.png
This functionality is available in RadiMation® version 5.2 and newer.