|
|
|
|
|
- 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
WDSQL: Creating and executing a script
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.
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: - Select "File .. Create a query" (or click ). The wizard starts.
- Select "A script for creating a new table". Go to the next step.
- Type the name of the table to create ("Table name" option).
- 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.
- Check (if necessary) "Generate the DROP TABLE command" to automatically generate the "DROP TABLE" command.
Reminder: The DROP TABLE command deletes a table. - Finish the wizard. The SQL code of the script for table creation is automatically displayed in the main window of WDSQL.
To run a script: - Load (if necessary) the script to run in WDSQL (select "File .. Load a query" or click ).
- Select "Execution .. Run a script in batch" (or click ).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|