PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • Creating a query in SQL code
  • Reverse engineering of query in SQL code
  • Runtime modes of a query in SQL code
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 also allows you to create a query by typing SQL code (if you are familiar with this language).

Important

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.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
How to proceed?

Creating a query in SQL code

To create a query in SQL code:
  1. Select "File .. New .. Query". The wizard for query creation starts.Click among the quick access buttons.
    • Click "Queries" in the wheel that is displayed. The window for creating a new element is displayed: click "Query".
    • The wizard for query creation 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 must be attached.
    Validate the wizard screen.
  4. Type the name of the query (name of the ".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 the query. This caption will be used in the project documentation.
    Note: 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.". The 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 Java You cannot run queries whose SQL code contains WLanguage functions.
  8. Save the SQL code ( Save ).

Reverse engineering of query in SQL code

The reverse engineering of the query in SQL code is used to graphically represent the query from the 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. Click SQL reverse analysis to graphically represent the query (or select "Query .. Reverse engineering of the query").To represent the query graphically, on the "Query" pane, in the "Analyze" group, click "Reverse Engineering".
Limits:
  • 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 the 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 a 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 type of connection (Oracle, SQL Server, ...). All the SQL commands supported by the accessed database can be used.
Note: 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 required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment