Déjà Vu X3 allows you to use SQL commands to modify Projects. By using SQL commands you can make direct changes to the underlying structure of the database of the project file. This means that you can make almost any conceivable changes to the information contained in the project. Using SQL commands to modify projects also allows you to make changes to many entries in the projects at once, thus saving you time, compared to making the changes by hand.
You can run SQL commands on a Project by opening the database in Déjà Vu X3, and then using the Execute SQL dialog.
Opening the Execute SQL dialog
First, open the project that you wish to run SQL commands on. Then, open the Execute SQL dialog:
- Access the Project section of the ribbon, and then click on the button Execute SQL.
- The Execute SQL dialog appears:
The Execute SQL dialog
The Execute SQL dialog has several components:
- The SQL Statement textbox. This is where you type the commands that will be executed.
- The Available Fields combo box. This will show a list of fields that exist in the database; this saves you from having to type the names of the fields, which may be difficult to remember in some cases.
- The Statement Name textbox. You can use this to load SQL commands that you have saved beforehand, as well as save an SQL command you have already typed in the SQL Statement textbox.
Typing the SQL commands
You can type an SQL command into the SQL Statement textbox, or copy a command from somewhere else and paste it into the textbox. While you are typing the command, you can use the Available Fields combo box to help you:
By clicking on the combo box, you will see a list of the names of the fields that exist in the current database. If you click on one of those names, Déjà Vu X3 will insert the name of the field into the SQL Statement textbox, thus saving you from having to type the name.
When you have finished typing the command you want to run, you should ask Déjà Vu X3 to validate it. Validating means that Déjà Vu X3 will check the syntax of the command you have typed to make sure that it is validnote. To validate the command you have written, click on Validate. Déjà Vu X3 will check the commands you have written and let you know if they are correct:
When you are ready to run the command, click Execute.
Saving an SQL command
Déjà Vu X3 allows you to save the command you have typed into the SQL Statement textbox, so that you can easily use the same command again later. This can save you a lot of time if you use a few commands very often.
To save the command:
- Type the name you want to give the saved command in the Statement Name textbox:
- Click Save.
Loading a saved SQL command
To load a saved SQL command:
- Click on the downward pointing arrow in the Statement Name textbox:
- Click on the name of the saved SQL command that you want to run:
- The saved command will be inserted in the SQL Statement textbox. You can modify it if necessary, or just run it by clicking Execute: