PC SOFT

WINDEV的在线文档

  • Overview
  • Result of the query test
  • Result of the test
  • 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)
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

Overview
The query editor allows you to run the test of the query result (or "Run the query test" from the popup 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.
  • When running 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 the Live Data is enabled. See Live Data for more details.
  • The buttonis used to automatically display the mean, the total, the maximum value and the minimum value of the numeric result items.

ImportantReports & Queries cannot be used to run the test:
  • of Insert queries,
  • of Update queries,
  • of Delete queries.
When running the test of a query in the user version of the query editor, the initialization process of the project is run.

Result of the query test

Result of the test

The result of the test depends on the type of the 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 result of the query 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 involved in the query is password protected, during the test of the query:
  • if the password is specified in the initialization code of the project (H密码), the query is run.
  • If the management of HFSQL errors was not customized (H自定义错误处理) 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 the 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 OLEDB 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 description of the query ("Query description" from the popup menu of the 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 enter the name of a dynamic connection (defined by programming with H描述连接).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the initialization code of the project,
      • in a code run from the initialization code of the project.
  • Insert, Update or Delete query:
    1. Display the description of the query ("Query description" from the popup menu of the 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 enter the name of a dynamic connection (defined by programming with H描述连接).
      Caution: If you are using a dynamic connection, this connection must be defined:
      • in the initialization code of the project
      • in a code run from the initialization code of the project.
This mode can be used if you directly enter the SQL code of your query in the query editor.
Note: At run time, the h查询.无修正 constant can be directly specified in H执行查询.

The effects of the 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 H执行SQL查询.
Replacing all the proprietary PC SOFT symbols (example: ']=' 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.
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.