PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • 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 result of the query 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.
ImportantReminder: Reports & Queries cannot be used to create: Insert queries, Update queries, Delete queries.
Query in a window or in a page

Overview

WINDEVWEBDEV - Server codeWINDEV Mobile 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.
ImportantThe queries created with Reports & Queries can be run from a WINDEV application only if this application supports the queries created with Reports & Queries
WINDEVWINDEV Mobile

Using a query in a window

To use a query in a window:
  1. Select "File .. New .. Window".Click among the quick access buttons.
    • Click "Window" in the wheel that is displayed. The window for creating a new element is displayed: click "Window" then "Window".
    • The wizard for window creation starts.
  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 wizard for window creation starts.
  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. Select "File .. New .. Page".Click among the quick access buttons.
    • Click "Page" in the wheel that is displayed. The window for creating a new element is displayed: click "Page" then "Page".
    • The wizard for page creation 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 wizard for page creation 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
WINDEVWEBDEV - Server codeWINDEV Mobile All the controls that can be linked to a data source can be associated with one or more result items of the query (edit control, list box, table, ...).
A query can be used as data source for a control. The control will display the records selected by the query.
ImportantThe 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 result of the query 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 ("Insert .. Control..."). The wizard for control creation starts.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. Select "Display .. Description of selection". The description window of the control is displayed.On the "Modification" pane, in the "Help for edit" group, click "Description". The description window of the control is displayed.
  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>)
Note: 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: allows you to automatically create a report based on the current Select query.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 required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment