Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Overview
  • How to do it?
  • Creating a query in SQL code
  • Reverse engineering of query in SQL code
  • Runtime modes of a query in SQL code
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
The query editor also allows you to create a query by typing SQL code (if you are familiar with this language).


Reports & Queries cannot be used to create queries in SQL code using the INSERT, UPDATE or DELETE commands.
See the SQL commands available in an SQL query for more details. Remark: From version 19, HFSQL is the new name of HyperFileSQL.
How to do it?

Creating a query in SQL code

To create a query in SQL code:
  1. Click among the quick access buttons.
    • The element creation window appears: click "Query".
    • The query creation wizard starts.
  2. Specify that you want to create a query by entering the SQL code directly ("SQL code" option).
  3. If your project is linked to no analysis, specify the analysis to which the query will be attached.
    Validate the wizard screen.
  4. Type the query name (name of ".WDR" file corresponding to the query). This name will be used to identify the query in your programs.
  5. Specify the caption of the query by briefly describing the purpose of query. This caption will be used in the project documentation.
    Remark: The query name is automatically defined from the caption typed.
  6. Validate the query creation. A code window is displayed.
  7. Type the SQL code of your query. You can insert into the query:
    • comments by writing the "--" or "//" character in front of them. Only comments about the selection conditions will be taken into account during the reverse engineering of the query: the other comments will be automatically deleted. The comments about the selection conditions with parameters will not be proposed when running a GO of query.
    • WLanguage functions. The WLanguage functions must be prefixed by "WL.". Assisted input is available. The WLanguage functions can be nested. Example:
      SELECT Customer.CustomerNum FROM Customer
      WHERE WL.LEFT(Customer.ZipCode,2)=75

      AndroidAndroid Widget You cannot run queries whose SQL code contains WLanguage functions.
  8. Save the SQL code ( Save ).

Reverse engineering of query in SQL code

Retroanalysis of the query in SQL code allows the query to be graphically represented from the data files found in the SQL code and in the project analysis.
To perform the reverse engineering of a query in SQL code:
  1. Display the SQL code of the query.
  2. To represent the query graphically, go to the "Query" pane, "Analyze" group and click "Reverse Engineering".
  • This feature is available for the SELECT, UPDATE, DELETE and INSERT queries.
  • The sub-queries are not imported.
  • The queries of queries are not supported.
  • The UNION queries are not supported.
  • This feature is available only if the SQL commands used in the query are recognized by the HFSQL engine. See SQL commands available in an SQL query for more details.
Runtime modes of a query in SQL code
The query editor allows you to easily run queries in SQL code. These queries can be:
Two runtime modes are available for the SQL queries:
  • Running an SQL query while checking the SQL code: This option is available by default for all the SQL queries run from WINDEV. The SQL code of the query must use the commands listed below. In this case, the HFSQL engine checks the SQL code of query.
  • Running an SQL query without checking the SQL code (with the hQueryWithoutCorrection constant): This option is recommended for the queries run via a native access or OLE DB. In this case, the HFSQL engine does not check the query. This option must be used if the query contains commands specific to a connection type (Oracle, SQL Server, etc.). All the SQL commands supported by the accessed database can be used.
Remark: The hQueryWithoutCorrection constant is also available when the query test is run from the query editor:
  • for a Select Query: click the "Advanced" button of the description window and check "Run with hQueryWithoutCorrection in test mode" in the "hQueryWithoutCorrection" tab.
  • for an Insert query, an Update query or a Delete query: check "Run hQueryWithoutCorrection in Test Mode" in the "General" tab in the description window.
Minimum version required
  • Version 9
This page is also available for…
Example HexecuteSqlQuery with WHILE HOut() = False
numero_corrida é int = 0

MyProcedureUltimaCorrida é fonte de dados

IF HExecuteSQLQuery (MyProcedureUltimaCorrida, ConnNativa, hQueryWithoutCorrection, "NG0002_Procedure_UltimaCorrida") THEN

HReadFirst (MyProcedureUltimaCorrida, num_corrida)

ENQUANTO Hout () = False

ok = HReadNext (MyProcedureUltimaCorrida, num_corrida)

numero_corrida = MyProcedureUltimaCorrida.num_corrida



Erro (HErrorInfo ())


Rastreio (numero_corrida)
29 Mar. 2019