PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Result of query test
  • Test result
  • Handling the result
  • Notes
  • Managing the passwords of data files
  • Taking the hQueryWithoutCorrection constant into account during the test (query that is using a connection)
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The query editor allows you to run the test of query result ( Go or "Run the query test" from the popup menu of query).
The initialization code of project is run during the query test.
Query result
Notes:
  • Several query tests can be run at the same time.
  • Versions 21 and later
    The last test run (window, query, report, ...) can be re-run from any project element via "GO .. Re-run the last test" found in the quick access buttons.
    Re-run the last test
    New in version 21
    The last test run (window, query, report, ...) can be re-run from any project element via "GO .. Re-run the last test" found in the quick access buttons.
    Re-run the last test
    The last test run (window, query, report, ...) can be re-run from any project element via "GO .. Re-run the last test" found in the quick access buttons.
    Re-run 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. See Live Data for more details.
  • The Calculator button is used to automatically display the mean, the total, the minimum and maximum values for the numeric result items.

Important

Reports & Queries cannot be used to check:
  • insert queries,
  • update queries,
  • delete queries.
The initialization process of project is run during the query test in the user version of query editor.
Result of query test

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 a HFSQL file.
  • Printed.
A record found in the query result can also be copied into the clipboard.
See Result of a query in test mode for more details.
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 initialization code of project (HPass), the query is run.
  • If the management of HFSQL errors was not customized (HOnError) and if the password is not specified by programming, the standard window for password input is displayed.
    Note: if the management of errors is customized in the initialization code of project, this management of errors will be used.

Taking the hQueryWithoutCorrection constant into account during the test (query that is using 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" from the popup 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 directly type the name of a dynamic connection (defined by programming with HDescribeConnection).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the initialization code of project,
      • in a code run from the initialization code of project.
  • Insert, Update or Delete query:
    1. Display the query description ("Query description" from the popup 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 directly type the name of a dynamic connection (defined by programming with HDescribeConnection).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the initialization code of project
      • in a code run from the initialization code of project.
This mode can be used if you directly type the SQL code of your query in the query editor.
Note: At run time, the hQueryWithoutCorrection constant can be directly specified in HExecuteQuery.

The effects of hQueryWithoutCorrection constant
hQueryWithoutCorrection is not specifiedhQueryWithoutCorrection is specified
Automatically define the connection associated with the files found in the query.The connection to use must be specified in HExecuteSQLQuery.
Replace all proprietary PC SOFT symbols (example: ']=' starts with ) by 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.
Format the floats (the decimal separator can be '.' or ',')No formatting is performed for the floats.
Depending on the database used, the alias names are replaced by the full names of the items in WHERE, ORDER BY and GROUP BY.
For example, the JET engine (Access, dBase, ...) 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 required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment