ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Editors / Query editor
  • Overview
  • Query in a window or in a page
  • Overview
  • Using a query in a window
  • Using a query in a page
  • Query in a control found in a WINDEV window or in a WEBDEV page
  • Displaying the query result in a List Box, Combo Box, Looper or Table control
  • Using a result item of the query in a control:
  • Query in a report
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The result of a select query can be used in:
  • a WINDEV and WINDEV Mobile application or a WEBDEV website,
  • a window (created by the wizard in WINDEV or WINDEV Mobile),
  • a page (created by the wizard in WEBDEV),
  • a window control (table, list box, combo box, ... in WINDEV or WINDEV Mobile),
  • a page control (looper, table, list box, combo box, ... in WEBDEV),
  • a report.
The result of an insert query, update query or delete query can only be used in a program.
Reports & Queries
Reminder: Reports & Queries cannot be used to create: Insert queries, Update queries, Delete queries.
For more details, see Running the query and handling the result with the WLanguage functions.
Query in a window or in a page

Overview

A query can be used as data source for a window or for a page. The window or the page will display the records selected by the query.
Reports & Queries
The queries created with Reports & Queries can be run from a WINDEV application only if this application supports the queries created with Reports & Queries
WINDEV

Using a query in a window

To use a query in a window:
  1. Click in the quick access buttons.
    • The new element window appears: click "Window" then "Window".
    • The window creation wizard opens.
  2. In the RAD tab, choose the RAD pattern to use and the type of window to create.
  3. Specify (if necessary) the skin template of the window and validate the creation. The window creation wizard opens.
  4. In the creation wizard, select the query that will be associated with the window and the items that will be displayed in the window.
  5. Validate. The created window will display the information coming from the associated query.
WEBDEV - Server code

Using a query in a page

To use a query in a page:
  1. Click in the quick access buttons.
    • The new element window appears: click "Page" then "Page".
    • The page creation wizard starts.
  2. In the RAD tab, choose the RAD pattern to use and the type of page to create.
  3. Specify (if necessary) the page template and validate the creation. The page creation wizard starts.
  4. In the creation wizard, select the query that will be associated with the page and the items that will be displayed in the page.
  5. Validate. The created page will display the information coming from the associated query.
Query in a control found in a WINDEV window or in a WEBDEV page
All the controls that can be bound to a data source can be bound to one or more result items of the query (Edit control, List Box, Table, etc.).
A query can be used as data source for a control. The control will display the records selected by the query.
Reports & Queries
The queries created with Reports & Queries can be run from a WINDEV application only if this application supports the queries created with Reports & Queries

Displaying the query result in a List Box, Combo Box, Looper or Table control

To display the query result in a List Box, Combo Box, Looper or Table control:
  1. Open the window or the page into which the List Box, Combo Box, Looper or Table control will be added.
  2. Insert the control associated with the query (via the "Creation" tab of the ribbon). The control creation wizard starts.
  3. Specify that the information displayed in the control comes from an existing query.
  4. Select the query that will be associated with the control and the items that will be displayed in the control.
  5. Validate. The created control will display the information coming from the associated query.
  6. Type (if necessary) the following line of code in the initialization process of the control. This line of code is used to initialize and run the query, and to display the query result in the current control.
    HExecuteQuery(<Name of associated query>)

Using a result item of the query in a control:

To use a result item of the query in a control (other than a List Box, Combo Box, Looper or Table):
  1. Open the window or the page into which a control associated with a query will be added.
  2. Create the control associated with the query.
  3. On the "Modification" tab, in the "Editing help" group, click "Description". The control description window appears.
  4. Go to the "Binding" tab in the control description window.
  5. Select the item to be displayed in the "Bound item" option.
  6. Validate. The created control will display the information coming from the associated query.
  7. Type (if necessary) the following line of code in the initialization process of the control. This line of code is used to initialize and run the query, and to display the query result in the current control.
    HExecuteQuery(<Name of associated query>)
Remark: When creating a Table control associated with a query, you can:
  1. Select the query in the "Project" pane directly.
  2. Perform a Drag and Drop toward the window. A table associated with the query is automatically created in the window or page.
Query in a report
A query can be used as data source for a report. The report will display the records selected by the query.
For more details, see Report based on a query.
Tip: On the "Query" tab, in the "Data binding" group, "Create a report" automatically creates a report based on the current selection query.
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 12/08/2023

Send a report | Local help