ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Tools / WDSQL
  • Overview
  • Creating a script
  • Creating a script from the main window of WDSQL
  • Creating a script for creating a new table in the current database
  • Running a script
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
A script is a set of SQL commands used to perform a specific operation (create a new table in the database, insert records, ...).
A script includes several lines. Each script line contains an SQL code that can be run independently.
A script must be run line by line, in Batch mode.
Remark: The following operations are only possible on files accessed via an OLE DB provider, ODBC driver or native access:
  • Creating the structure of a file/table.
  • Modifying the structure of a file/table.
  • Deleting the structure of a file/table.
Creating a script
A script can be created:
  • fom the main window of WDSQL,
  • from the wizard for table creation (script for table creation).
Remarks:
  • To save a script, select "File .. Save a query" or click .
  • To print the SQL code of a script, select "File .. Print the source code of the query" or click .

Creating a script from the main window of WDSQL

WDSQL proposes several methods to help you create the script in SQL:
  • To view and/or use existing fields in the current database, click on the icon.. For more details, see Database structure.
  • To view and/or use the various SQL keywords, click on the icon.
  • To view the different types of variables recognized by the current database, click on the icon.

Creating a script for creating a new table in the current database

To create a script for creating a new table in the current database:
  1. Select "File .. Create a query" (or click ). The wizard starts.
  2. Select "A script for creating a new table". Go to the next step.
  3. Type the name of the table to create ("Table name" option).
  4. For each table item:
    • Type the item name ("Control name" option).
    • Click the "Add" button.
    • Specify the type of item. The available types depend on the current database.
    • Specify the item size.
    • Specify whether the item must be indexed.
    • Specify whether the item can be null.
  5. Check (if necessary) "Generate the DROP TABLE command" to automatically generate the "DROP TABLE" command.
    Reminder: The DROP TABLE command deletes a table.
  6. Finish the wizard. The SQL code of the script for table creation is automatically displayed in the main window of WDSQL.
Running a script
To run a script:
  1. Load (if necessary) the script to run in WDSQL (select "File .. Load a query" or click ).
  2. Select "Execution .. Run a script in batch" (or click ).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/21/2024

Send a report | Local help