|
|
|
|
|
- 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)
The query editor allows you to test the query result ( or "Test query" in the context menu of the query). During the test of the query, the initialization code of the project is run.
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.
- 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 . The following menu is displayed: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 button is used to automatically display the mean, the total, the minimum and maximum values for the numeric result items.
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. 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:
- Display the query description ("Query description" in the context menu of query).
- In the right section, click the "Advanced" button. The window for advanced parameters is displayed.
- Display the "hQueryWithoutCorrection" tab.
- Check "Run with hQueryWithoutCorrection in test mode".
- 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:
- Display the query description ("Query description" in the context menu of query, "General" tab).
- Check "Run with hQueryWithoutCorrection in test mode".
- 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 specified | hQueryWithoutCorrection 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. |
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|