Interactive SQL Window

From InterBase

Go Up to IBConsole Windows and Tools

The IBConsole isql Window permits you to execute DDL and DML commands to the InterBase server as well as to load, save, print, cut, paste, and copy SQL scripts and results.

To display the isql window:

  • Click the Interactive SQL toolbar button IBConsole-Toolbar-InteractiveSQL.png.
  • Choose Tools|Interactive SQL.

ISQLWindowMain.png

Tables and Views

In this section you have a list of all the tables and views for the current database, you can use the search bar to find a specific table or view. The SQL input area is where you can type SQL statements or scripts to be executed. The status bar at the bottom of the SQL input area displays information relevant to the SQL input areas such as cursor position, input status, client dialect, and transaction status. You can change the client dialect by right clicking on the status bar.

Fields

The Fields section displays a list of all the fields in the currently selected table. You can use the search bar to find specific fields.

Result

The Results section is where the results of the SQL statements or scripts are displayed. It scrolls both horizontally and vertically. The SQL output area contains the following tabs:

  • The Data tab displays any data returned by the SQL output in a grid format.
  • The Plan tab displays the plan for the SQL statement or script.
  • The Statistics tab displays statistics for the SQL output, including: execution time, prepare time, starting memory, delta memory, current memory, number of buffers, number of reads, number of writes, the plan, and the number of records fetched.
  • The Errors tab displays any errors during execution.
  • The Show tab displays the output of isql SHOW statements.

Menu Bar

File Menu

The File menu contains the following entries:

  • Print prints the current contents of the SQL input area.
  • Save saves the stack of SQL commands from the current session to a file.
  • Load loads a saved SQL history file.
  • Close closes the SQL Editor.

Edit Menu

The Edit menu contains the following entries:

  • Undo, Cut, and Paste are for use in the SQL input area only. “Undo” in the Edit menu does not undo database changes. Use Transactions|Rollback to undo database changes.
  • Copy, Select All, and Find are for use in both the input and output area.
  • Font specifies the font to be used in the input area.
  • Options includes settings for query plan, auto commit, Blobs, and terminators. For more information refer to Changing isql Settings.
  • Highlight Options allows you to set the appearance of text in the input area.

Query Menu

The Query menu contains the following entries:

  • Load Script loads a SQL script file.
  • Save Script saves a SQL script file.
  • Next steps you forward to the next SQL statement after you have used the Previous command to display earlier statements in the stack.
  • Previous displays the previous statement that you entered in the input area. This command can be used repeatedly to step through the stack of statements entered during the current interactive SQL session.
  • Execute executes the SQL statements currently displayed in the input area.
  • Execute Selection executes the selected portion of the SQL statement displayed.
  • Fetch All forces the IBConsole to fetch all the rows of a subquery rather than a subset. Rarely needed, because IBConsole fetches the results as you scroll down in the output area.
  • Prepare displays the optimization plan in the SQL output area.
  • Cancel exits the optimization plan.
  • Save Output saves the contents of the output area to a text file.
  • Wizard opens the Query Wizard where you can create query scripts.

Database Menu

The Database menu contains the following entries:

  • Connect As allows you to connect to the database as a different user.
  • New Connection is active only when you are not connected to a database. It displays the Database Connect dialog.
  • Create Database and Drop Database are exactly the same as the equivalent commands in the main IBConsole Database menu. They are provided in the SQL Editor Database menu for convenience.

Transactions Menu

The Transactions menu allows you to commit or roll back transactions.

Windows Menu

Clicking the Windows menu displays a list of current open windows. You can display a window by highlighting it in the list and clicking Switch to or by double-clicking the entry.

Toolbar

The IBConsole SQL Editor toolbar contains the following buttons:

Toolbar Buttons for Executing SQL Statements
Button Description

InteractSQLqueryWizard.png

Opens the Query Wizard which helps you creating query scripts.

PrevQuery.png

Displays the previous statement that you entered in the input area. This button can be used repeatedly to step through the stack of statements entered during the current interactive SQL session. The accelerator key is W-P. Click the down arrow next to the button to see a list of available statements. Click a statement in the list to display it in the input area. (Same as Query>Previous.)

InteracSQLnext.png

Steps you forward to the next SQL statement after you have used the Previous command to display earlier statements in the stack. The accelerator key is W-N. Click the down arrow next to the button to see a list of available statements. Click a statement in the list to display it in the input area. (Same as Query>Next.)

InteracSQLexecute.png

Executes the current statement or script in the SQL input area. The output is displayed in the SQL output area. The accelerator key is W‑E. (Same as Query>Execute.)

InteracSQLprepare.png

Displays the query plan for the current query in the SQL output area. (Same as Query>Prepare.)

InteractSQLFetchAll.png

Forces IBConsole to fetch all the rows of a subquery rather than a subset. Rarely needed, because IBConsole fetches the results as you scroll down in the output area. (Same as Query>Fetch All.)

InteracSQLcommit.png

Commits the transaction specified by the SQL statement to the database. (Same as Transactions>Commit.)

InteracSQLrollback.png

Rolls back all database changes since the last commit. (Same as Transactions>Rollback.)

InteracSQLload.png

Loads a script for SQL execution into the SQL input area. (Same as Query>Load Script.)

InteracSQLsave.png

Saves SQL statements entered in the SQL input area to a file. (Same as Query>Save Script.)

InteracSQLfind.png

Finds text in the SQL input area. (Same as Edit>Find.)

InteracSQLprint.png

Prints the contents of the SQL input area.

Advance To: