PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Overview
  • Query in a window or in a page
  • Overview
  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The result of a select query can be used in:
  • a WINDEV application, a WINDEV Mobile application or a WEBDEV site,
  • 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.

Important

Reminder: Reports & Queries cannot be used to create: Insert queries, Update queries, Delete queries.
See Running the query and handling the result with the WLanguage functions for more details.
Query in a window or in a page

Overview

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

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" pane of ribbon). The wizard for control creation 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 code line in the initialization process of the control. This code line 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" pane, in the "Help for edit" group, click "Description". The control description window appears.
  4. Display the "Link" tab in the description window of the control.
  5. Select the item to display in the "Linked item" option.
  6. Validate. The created control will display the information coming from the associated query.
  7. Type (if necessary) the following code line in the initialization process of the control. This code line 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 in the 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.
See Report on query for more details.
Tip: On the "Query" pane, in the "File Link" group, the "Create a report" option is used to automatically create a report based on the current Select query.
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment