Query Pane: Working with Queries

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > Menu Commands > DB Menu > Query Database >

Query Pane: Working with Queries

After connecting to a database, an SQL script can be entered in the SQL Editor and executed. This section describes:

 

How an SQL script is entered in the SQL Editor.
How the script is executed in the Database Query window.

 

The following icons are referred to in this section:

 

ic_dbqry_execute

Execute Query

Executes currently selected SQL statement. If script contains multiple statements and none is selected, then all are executed.

ic_dbqry_executeedit

Execute for Data Editing

Same as for Execute command, except that results (in Results tab) are editable.

ic-sql-import

Import SQL File

Opens an SQL file in the SQL Editor.

 

Creating SQL statements and scripts in the SQL Editor

The following GUI methods can be used to create SQL statements or scripts:

 

Drag and drop: Drag an object from the Browser pane into the SQL Editor. An SQL statement is generated to query the database for that object.
Context menu: Right-click an object in the Browser pane and select Show in SQL Editor | Select.
Manual entry: Type SQL statements directly in SQL Editor. The Auto-completion feature can help with editing.
Import an SQL script: Click the Import SQL File icon in the toolbar of the Database Query window.

 

Executing SQL statements

If the SQL script in the SQL Editor has more than one SQL statement, select the statement to execute and click either the Execute icon or Execute with Data Editing icon in the toolbar of the Database Query window. If no statement in the SQL script is selected, then all the statements in the script are executed. The database data is retrieved and displayed as a grid in the Results tab. If Execute with Data Editing was selected, then the retrieved data in the Result Grid can be edited. Messages about the execution are displayed in the Messages tab.

 


© 2019 Altova GmbH