Data Access Getting Started > Additional Features > Using Query Mode > Additional Information about Query Mode
 
Additional Information about Query Mode
Query mode lets you specify interactively a query to apply to the SQL table.
To use query mode, you must first add a DbNavigator gadget that displays the query mode button and validation buttons and is connected to the data source.
Switching to Query Mode
To enter query mode, click the query mode button of the DbNavigator gadget.
When query mode is entered, the data source substitutes a memory table for the SQL table. This memory table has the same number of columns as the SQL table, but differs in that all columns in the memory table have a String type.
The user can then edit the contents of the memory table through the same set of gadgets that are used to edit the SQL table in regular (nonquery) mode.
Entering the Query
Each column of the memory table can contain:
*A literal value (implying the = relational operator)
*A value containing the SQL wildcard character % or _ (implying the LIKE SQL operator)
*An SQL condition (such as NULL, NOT NULL, LIKE ‘ABC’, BETWEEN 1 AND 2, =, <>, and so on)
The memory table can contain more than one row. All conditions that appear on the same line will be combined with an AND operator when the query is applied. Conditions that appear on different lines will be combined with an OR operator.
If the DbNavigator displays the current position and/or the number of lines, while in query mode, these fields will display Q: in front of the value to show that query mode is active.
Applying and Canceling the Query
To apply the query, click the validate button of the DbNavigator gadget. The portion of the WHERE clause based on the contents of the memory table will be synthesized. It will then be assigned to the SQL table query conjunct property and the data source will revert to using the SQL table instead of the memory table so that all connected gadgets show the contents of the SQL table.
Alternatively, the user can cancel the query by clicking the cancel button of the DbNavigator gadget. This simply reverts to using the SQL table instead of the memory table so that all connected gadgets show the contents of the SQL table.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.