ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Test
  • Overview
  • Query test result
  • Test result
  • Handling the result
  • Notes
  • Managing the passwords of data files
  • Taking the hQueryWithoutCorrection constant into account during the test (query that uses a connection)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The query editor allows you to test the query result (Go or "Test query" in the context menu of the query).
During the test of the query, the initialization code of the project is run.
Result of the query
Notes:
  • Several query tests can be run at the same time.
  • The last test run (window, query, report, etc.) can be run again from any project element via the "GO .. Re-run the last test" option in the quick access buttons.
    Re-running the last test
  • During the test of a query with parameters, a window allows you to specify the different parameters.
    In this window, you have the ability to select an existing value via Existing value. The following menu is displayed:
    Test values
    You can:
    • select one of the possible values among the values found in the file,
    • view the entire file.
      Caution: This option is available only if Live Data is enabled. For more details, see Live Data.
  • The Calculator button is used to automatically display the mean, the total, the minimum and maximum values for the numeric result items.
Reports and Queries cannot be used to check:
  • insert queries,
  • update queries,
  • delete queries.
When the query is tested in Reports and Queries, the "Project initialization" event is executed.
Query test result

Test result

The test result depends on the type of query:
  • The result of a select query corresponds to the records selected by the query.
  • The result of an insert query corresponds to the record that will be inserted. During the test, the record is directly inserted into the file.
  • The result of an update query corresponds to the records that will be modified. During the test, you can:
    • see the records that will be modified,
    • modify the records in the file.
  • The result of a delete query corresponds to the records that will be deleted. During the test, you can:
    • see the records that will be deleted,
    • delete the records from the file.

Handling the result

Then, the query result can be:
  • Exported to a text file.
  • Exported to an XML file.
  • Exported to an Excel file.
  • Exported to an HFSQL file.
  • Printed.
A record found in the query result can also be copied to the clipboard.
For more details, see Result of a query in test mode.
Notes

Managing the passwords of data files

If one of the data files taking part in the query is password protected, during the test of the query:
  • If the password is specified in the project initialization code (HPass), the query is executed.
  • If the management of HFSQL errors was not customized (HOnError) and if the password is not specified through programming, the standard window for password input is displayed.
    Remark: if the management of errors is customized in the project initialization code, this management of errors will be used.

Taking the hQueryWithoutCorrection constant into account during the test (query that uses a connection)

By default, WINDEV and WEBDEV interpret the SQL queries on OLE DB and on ODBC via the OLE DB provider.
To prevent the query from being interpreted during a test in the query editor:
  • Select query:
    1. Display the query description ("Query description" in the context menu of query).
    2. In the right section, click the "Advanced" button. The window for advanced parameters is displayed.
    3. Display the "hQueryWithoutCorrection" tab.
    4. Check "Run with hQueryWithoutCorrection in test mode".
    5. In the list, select the connection to use. The list presents the different connections defined in the data model editor. You can also enter directly the name of a dynamic connection (defined programmatically with HDescribeConnection).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the project initialization code,
      • in a code run from the project initialization code.
  • Insert, Update or Delete query:
    1. Display the query description ("Query description" in the context menu of query, "General" tab).
    2. Check "Run with hQueryWithoutCorrection in test mode".
    3. In the list, select the connection to use. The list presents the different connections defined in the data model editor. You can also enter directly the name of a dynamic connection (defined programmatically with HDescribeConnection).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the project initialization code
      • in a code run from the project initialization code.
This mode can be used if you directly type the SQL code of your query in the query editor.
Remark: At runtime, the hQueryWithoutCorrection constant can be directly specified in HExecuteQuery.
The effects of hQueryWithoutCorrection constant
hQueryWithoutCorrection is not specifiedhQueryWithoutCorrection is specified
The connection associated with the data files in the query is defined automatically.The connection to use must be specified in HExecuteSQLQuery.
All PC SOFT proprietary signs are replaced (e.g.: ']=' starts with) with their equivalent in standard SQL.No replacement is performed. The standard SQL symbols must be used.
Format the dates and times according to the format used by the database.
For example, the WINDEV dates are in 'YYYYMMDD' format while in Access, the dates are in #YYYYDDMM# or #YYYYMMDD# format depending on the system language.
No formatting is performed. The format recognized by the database must be used.
Floats are formatted (the decimal separator can be '.' or ',')No formatting is performed for the floats.
Depending on the database used, the alias names are replaced with the full names of the items in WHERE, ORDER BY and GROUP BY.
For example, the JET engine (Access, dBase, etc.) accepts no alias name in the Where clause of a query
No replacement is performed. The full names of the items must be used in the query code for WHERE, ORDER BY and GROUP BY.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/08/2023

Send a report | Local help