ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 a SQL code that can be run independently.
A script must be run line by line, in Batch mode.
Remark: The following operations can only be performed on files accessed via an OLE DB provider, an ODBC driver or a 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:
  • View and/or use the items found in the current database: click . For more details, see Database structure.
  • View and/or use the different SQL keywords: click .
  • View the different types of variables supported by the current database: click .

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 is used to delete 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/18/2023

Send a report | Local help