Table of Contents
SQL Editor - Editor Pane Help
Editor pane allows you effectively type a new SQL query(ies) or choose one from recent queries or favorite pre-defined queries.
You can use the Command Field to enter one SQL query or few queries separated by semicolon ';'. After you enter an SQL query(ies), the “Execute” button becomes active. Click it to execute the displayed query(ies).
On the top of this pane you can see own toolbar with few controls:
- “Execute” button - runs the query(ies) that present in the Command Field. Default shortcut is CMD+E (Ctrl+E for Windows). If success you will see SQL Editor - Result Pane Help, otherwise error message will be appended in the console output pane.
- “Recent Queries” button - shows list of Recent queries.
- “Favorites” popup button - shows menu of your favorite named SQL queries.
- “Templates” popup button - shows menu with the list of major SQL commands available for the current database engine.
- “Functions” button - opens “Function Browser” to help you choose one of SQL functions.
- “Parameters” menu - allows you to specify parameters of a query.
- “Active Database” menu - allows you to choose a database to which send queries.
- “Theme” menu - allows you to choose a theme for SQL Editor according to your habits.
When you click on Recent Queries button, you will see list of recent queries (if any) as the following.
- To choose a query from the list, just double click. You will be moved back to the Editor pane, and the query will replace anything that was in the editor, so you can click EXECUTE.
- You can select a query in the list by single click, then copy it CMD+C or using contextual menu. Then close list of recents and paste the query into editor.
- To close the list of recent queries, click red (x) button on the left.
- To clear the list of recent queries, click button “Clear All Recents”.
- You can filter recent queries using the “search” field on the right.
You can use this menu to define a new favorite query. For this choose “Add…” item when a query is ready and correct. You will be asked assign name for new query. After this query will be listed in this menu.
Future, you can choose a query from this menu by its name, and the body of query will be inserted into Editor.
You can delete some or all favorite queries using “Clear…” menu item, which opens a dialog where you can select them and delete.
“Templates” menu contains major SQL commands valid for the current database engine, to help you remember how a command looks.
Commands are listed by categories.
When you choose a command it is inserted into editor for your future editing.
Function Browser has three main areas:
- List of categories;
- List of functions in the select category;
- Description of a selected function. For each system function you can see its declaration and description.
When you have found a required function just click INSERT button to insert its prototype into SQL Editor’s query.
On the right side of toolbar of SQL Editor you can see menu with the switch icon. This menu collects set of options for SQL query execution. This options differ for database engines.
- Client Side - Defines the cursor location to be client side, i.e. all its records come into RAM of the client computer. It is good for small enough queries.
- Server Side - Defines the cursor location to be server side. Records come on demand to the RAM of client computer. It is good for queries with huge results.
|Database||Client-Side Cursor||Server-Side Cursor|
Defines the kind of record locks for server-side cursors. Client-side cursor applies read-only locks on short time while load result records from database.
- No Lock (Dirty Read) - No access locking.
- Read-Only (Uncommited Read) - Allows other users to read data (in its old state) but not to change it.
- Read/Write (Repeatable Read) - Other users are neither allowed to read nor change records of the table(s) you are working on.
- Outputs - If enabled, then Valentina Server can return output from the PRINT SQL command.
- Tunes - If enabled, then Valentina Server can return tune information about query execution.
- Warnings - If enabled, then Valentina Server can return warnings, if any, produced during query execution.