Follow

How To Run SQL Commands On A Project

This ensures that the SQL command you have written follows the "rules" of SQL: that the commands are spelled correctly, and that things are written in the right order. However, it cannot ensure that the command you have written will do exactly what you meant it to.

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.

Warning: by modifying the underlying structure of a Déjà Vu database directly, it is possible to make changes that render a database unusable in Déjà Vu. For this reason, we strongly recommend that you make a backup of any project you are going to edit before doing anything else; this way, you can restore the backup if you make any mistakes.

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:

  1. Access the Project section of the ribbon, and then click on the button Execute SQL.
  2. 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:

Or incorrect:

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:

  1. Type the name you want to give the saved command in the Statement Name textbox:
  2. Click Save.

Loading a saved SQL command

To load a saved SQL command:

  1. Click on the downward pointing arrow in the Statement Name textbox:
  2. Click on the name of the saved SQL command that you want to run:
  3. The saved command will be inserted in the SQL Statement textbox. You can modify it if necessary, or just run it by clicking Execute:
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk