Free-Text Queries

Rekall also includes support for free-text queries. These are accessed by setting the top-level block type to SQL block, or by inserting an SQL block into a form or report. The free-text query is specified by a server database and the text of the SQL query itself. The image below ( Thanks to one of our users for this example, names changed to protect the innocent! ) shows such a query (which also substitutes a parameter, but ignore that:)

The query must start with select ... from. Rekall parses the query in order to extract its component parts. The parser is fairly loose, for instance it will accept anything other than a keyword between the select and from, so a query that Rekall thinks is valid may be considered invalid by the server database ( Conversely, it is just about certain that there are queries that Rekall does not parse but which are valid. Please let us know if you experience problems in this respect, and we will extend the parser appropriately. ) . The property dialog for a free-text query has a Verify button that can be used to check the query.

Since Rekall parses the text of the query, when it is used in a form, Rekall will generally be able to save changes, that is, perform appropriate server database updates. However, since Rekall cannot see any relationships between the tables in the query ( This might be possible in a later version of Rekall, once there is either a relationship editor, or access is available to any relationship information stored in the server database. ) there is no structure information which allows the selection for a "top" table, and data will be accessed simply as a set of rows.

Generally speaking, free-text SQL queries should be used in order to display data, but not for update and delete functions. However, to allow some possibility of sensible update or delete operations, the Top Table property can be set to specify one of the tables in the query. In this case, updates and deletes will apply to the appropriate row in that table.