ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Editors / Query editor / Creating queries
  • Overview
  • How to?
  • Creating an insert query
  • Notes
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Creating an insert query
Overview
An insert query (SQL INSERT statement) is used to add records to a database file.
The following information is required to perform an insert query:
  • the data file into which the data will be inserted.
  • the items into which new values will be inserted.
For example, creating a new customer in the "Customer" data file:
Insert query
The query editor automatically generates the SQL code of this query.
To see the SQL code of a query:
  1. Open the context menu of the query graph.
  2. Select "SQL code".
You also have the ability to press the F2 key.
In our example:
INSERT INTO CUSTOMER
(
Title,
CustomerName,
Company,
Address1,
PostalCode,
City
)
VALUES
(
'Miss',
'Montgomery',
'UNISOFT',
'Accacia Avenue',
'75000',
'London'
)

Reports & Queries software cannot be used to create insert queries.
How to?

Creating an insert query

To create a new insert query:
  1. Click New in the quick access buttons.
    • In the window that appears, select "Query".
    • The query creation wizard opens.
  2. Specify that you want to create an insert query ("Insert" option).
    Wizard
  3. If your project is linked to no analysis, specify the analysis to which the query will be attached.
    Proceed to the next step of the wizard.
  4. Select the data file into which the data will be inserted.
    Go to the next step.
  5. The new values will be inserted into the different items of the data file. For each relevant item:
    • Click the "Value/Parameter" column.
    • In the popup window that appears, specify the value or the parameter that contains the value to be inserted.
      Possible values
      The new values to insert can correspond to:
      • the default value defined in the analysis.
      • a value that must be specified. Specify this value.
      • a value contained in a parameter. Specify the name of the parameter.
      • a null value.
    • Validate your choice.
  6. Repeat the previous steps for each item into which you want to insert a value .
    Note: the button automatically generates a parameter for each item not filled in.
  7. Go to the next step.
  8. Type the query name (name of ".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 query. This caption will be used in the project documentation.
    Note: The query name is defined automatically from the label entered.
  10. Validate the query description. The graphic representation of query is automatically displayed in the query editor.
Notes
  • To modify the characteristics of a query: in the "Query" pane, in the "Edit" group, click on "Description". For more details, see Description of a query.
  • To generate the SQL code corresponding to this query, select "SQL code" in the context menu of the query. If changes are made in the query description, these changes will be automatically reflected in 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 data files selected in the "Analysis" pane to the query editor.
  • The test of the created query can be run from the query editor. For more details, see Testing a query.
See also
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/10/2025

Send a report | Local help