PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to proceed?
  • Notes
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
A delete query (corresponding SQL statement DELETE) is used to delete records from a database file.
To perform this deletion, the main characteristics of the delete query are as follows:
  • the file from which the data will be deleted.
  • the selection conditions of the records to delete (customers who live in Seattle, products whose price is greater than 40 Dollars, etc.).
See Selection conditions of a query for more details.
For example, delete the orders placed before January 1st 2010:
Delete query
The query editor automatically generates the SQL code of this query.
To see the SQL code of a query:
  1. Display the popup menu of the query graph.
  2. Select "SQL code".
You also have the ability to press [F2].
DELETE FROM
ORDERS
WHERE
ORDERS.OrderDate < '20100101'

Important

Reports & Queries cannot be used to create delete queries.
How to proceed?
To create a new delete query:
  1. Select "File .. New .. Query". The wizard for query creation starts.Click New among the quick access buttons.
    • Click "Queries" in the wheel that is displayed. The window for creating a new element is displayed: click "Queries".
    • The wizard for query creation starts.
  2. Specify that you want to create a delete query with the wizard ("Delete" option).Specify that you want to create a delete query with the wizard ("Delete" option).
  3. If your project is linked to no analysis, specify the analysis to which the query must be attached.
  4. Go to the next wizard step.
  5. Select the data file from which the data will be deleted.
    Go to the next step.
  6. Define the selection conditions by clicking the "Condition" column of the relevant items. See Selection conditions of a query for more details.
    Go to the next step.
  7. Specify (if necessary) the sequence of the selection conditions with the conditional AND and OR AND operators:
    • Conditional AND operator: the selected records will match both conditions. For example, the customers whose name starts with the letter "A" AND who live in Denver.
    • Conditional OR operator: the selected records will match one of the two conditions or both conditions. For example, the query selects the customers who live in Seattle OR in Denver.
      Go to the next step.
  8. 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.
  9. Specify the caption of the query by briefly describing the purpose of the query. This caption will be used in the project documentation.
  10. Validate the description of the query. The graphic representation of the query is automatically displayed in the query editor.
Notes
  • To modify all the characteristics of a query, select "Delete query .. Query description". See Describing a query for more details.To modify all the characteristics of a query: on the "Query" pane, in the "Edit" group, click "Description". See Describing a query for more details.
  • To generate the SQL code corresponding to this query, select "Delete query .. SQL code". If modifications are performed in the description of the query, these modifications will be automatically carried over into the corresponding SQL code.To generate the SQL code corresponding to this query, select "SQL code" from the popup menu of the query. If modifications are performed in the description of the query, these modifications will be automatically carried over into the corresponding SQL code.
  • You also have the ability to create a query from one or more data files described in the data model editor: to do so, "Drag and Drop" the files selected in the "Analysis" pane to the query editor.
  • The test of the created query can be run from the query editor. See Running the test of a query for more details.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment