Online Documentation for All SQLManager.net Products

SQL Editor
Top  Previous  Next


SQL Editor is the basic DBISAM Manager tool for creating and executing queries. It allows you to create and edit SQL text for the query, prepare and execute queries and view the results of execution.

To call the SQL Editor select the Tools | Show SQL Editor / Tools | New SQL Editor menu item or press F12 / Shift + F12.

Edit Tab  

The Edit area is provided for working with the text of the query. For your convenience the Quick Code system is enabled, i.e. when you type the first word symbols in the SQL text editor you are offered some variants for the word completion in a popup list (analogue of the Code Insight in Delphi IDE). You can activate these popup lists yourself by pressing the following key combinations:

Ctrl+Space    All SQL keywords and database objects   
Ctrl+Alt+S    SQL glossary   
Ctrl+Alt+T    Table list   

Database objects are highlighted in the text. You can open the proper object editor by clicking the object name in the text, holding button Ctrl pressed on the keyboard.

The popup menu of the edit area contains standard functions for working with the text (Cut, Copy, Paste, Find, Replace, Toggle Bookmarks, etc) and also functions for processing the whole query, which allow you to execute/prepare query, save/load query to/from file, and preview/print query.

To execute the query click the Execute button on the toolbar. If the query text is correct, the query is executed and the Results page opens with the data returned by the query. If an error occurs while executing the query, execution stops, the statement causing the error is indicated with a purple line, and the error message is displayed in the bottom area.

SQL Editor Tabs 

Results
This page becomes available after the query is executed. It displays the result data, returned by the query, as a grid, a form or a printable report (see Data Frame for details). The popup menu of this tab and the buttons on the toolbar allow you to Export Data export, Export Data as INSERT exportasins. In procedures returning BLOB fields you can also call the BLOB Editor to view the content of the BLOB fields.

The status bar displays the number of records, acquired while executing the query.

Logs
On this page information of all the executed statements, including queries and carried out transactions, is displayed. In the comment bar execution date and time are displayed.

SQL Editor Toolbar  

The buttons on the SQL Editor toolbar allow you to perform the following operations over the query.

Button
Action


createdb Databases
Drops down with a list of registered databases, allowing you to select the database for the query.
load Load
Loads the query text from an *.sql file.
save Save
Saves the query text to an *.sql file.
saveall Save All
Saves all the queries to one *.sql file.
executeExecute
Executes the query.
defsize Default Size and Position
Brings the window to its default size and position (restricted by the main window and DB Explorer).
vqb Visual Query Builder
Activates the Visual Query Builder window for visual building the query.
add_item New Query
Creates the new clean page for the new query.
del_item Delete Current Query
Clears the current query page.
del_all Clear All History
Clears all the query pages open.
compile Start Transaction
Starts a transaction. Transaction starts automatically only on editing query data to prevent unnecessary table locking.
commit Commit Transaction
Commits the current transaction.
rollback Rollback Transaction
Rollbacks the current transaction.
close_res Close Result
Closes the Results page with the query result data.
find Find
Activates the Find Text Dialog for searching for the given text in the query text.
export Export Data ('Results' tab only)
Activates the Export Data Dialog, which allows you to export the result query data to file.
exportasins Export Data as INSERT Statements ('Results' tab only)
Activates the Export Data As Insert Dialog, which allows you to export the result query data to the SQL script as INSERT statements.


See also:
Visual Query Builder
SQL Script Editor