EPUB | CHM | PDF

How to Execute an SQL Script

Top Previous Next

You can send SQL queries to the connected PostgreSQL database and display the result. The queries can contain any possible statements, e.g. UPDATE, DELETE, INSERT, SELECT statements etc. Note, that it is possible to run multiple SQL queries simultaneously.

The result of the SELECT-containing queries will be shown in the grid-based dialogues.

To execute SQL queries:

1. Connect to the database using Database Connection Manager
or
Use the already established database connection.

2. Call the SQL Executor by selecting Database | SQL Executor menu item or pressing Ctrl-Shift-E.

3. Enter one or more SQL queries.

4. Click the Validate SQL button on the dialog window toolbar to check your queries. Database Designer Validator can check SQL only for grammar correctness. This means that it can't check correctness of the database objects name using, i.e. if you've been mistaken in the name of some table. However, you may execute an SQL without validating it: it will be checked before executing automatically.

5. Press F9 or click the Execute SQL button on the dialog window toolbar to execute your queries. A data grid window will be displayed for each SELECT-based query. To close the data grid window, click on the Close button. The execution status for each query will be displayed at the bottom of the SQL Executor dialog window.

6. Press Alt-F9 or click Execute SQL in Single Transaction button on the dialog window toolbar to execute your script in the context of the single transaction without pre-validation. This means the whole script will be sent to server without parsing and validation.

You can save your queries into a file. Click on the Save (icon-save-file) button on the SQL Executor toolbar.

Please note, that SQL Executor dialogue window is used by Database Generation and Database Modification tools.

See also:
Database Generation: Database Generation
Database Functions: Database Modification