SQL Properties

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

Home >  DatabaseSpy Projects > Properties >

SQL Properties

The following properties of SQL files as well as SQL Editor windows (with or without SQL statements) are displayed in the Properties window:

 

Overview

File Kind

Always reads "SQL" for SQL files.

 

 

Options

SQL Editor should require semicolons

Activate this check box to improve performance and reliability of all parser-dependent operations. Only statement that are terminated with a semicolon will be considered by the parser.

Group statements for execution with

Here you can choose how statements should be grouped when the script in the SQL Editor window is executed.

 

General

Database Kind

For unsaved SQL Editor windows, this drop-down list lets you define a database type. Note that this field will be adapted automatically if you choose a data source.

Data Source

Here you can choose from the data sources that have been added to the project. As several data sources may be active at one time, it is necessary to be able to assign data sources to SQL files as a group or individually.

 

Note: Assignments made in the Project tab apply to the SQL files when they are opened or executed.

Root Object

If a data source has already been selected, you can choose a root object from this drop-down list.

 

Description

Description

Here you can enter a description of the file.

 

 

Files

Creation Date

Modification Date

Access Date

Displays the respective creation and modification dates and shows when the file has last been accessed.

Size

Shows the file size.

Read Only

Hidden

These properties are read-only and can only be changed outside DatabaseSpy.

Full Path

Displays the full path to the file. To jump directly to this location, right-click the file in the Project window and select Locate File... from the context menu.

 

Default properties for SQL Editor windows

The following scenarios can occur when you open a new SQL Editor window:

 

No project: If no project has been opened in the Project window, any new SQL Editor window that you open will have the properties Database Kind = "Unknown" and Data Source = "Offline".
Data source connected: If you open an SQL Editor window immediately after you have connected to a data source, the connection properties of this data source will be used for that SQL Editor window. Note that the data source still has to be selected in the Project window.
Several data sources defined in one project: If you have opened a project with several different data sources, you can set the connection properties by clicking on a particular data source before opening an SQL Editor window. If you select a disconnected data source, the Execution Target Bar provides you with a Connect button to establish a connection to the data source. Clicking on any other item in the Project window will open an SQL Editor in the Offline mode.

 

Working with SQL files in the Offline mode

One of the options available to you when selecting from the Data Source combo box is "Offline". Designating an SQL file as offline means that it is blocked from being executed. The file cannot be executed when opened in the SQL Editor or when selecting Execute SQL from the context menu in the Project window.

 

All SQL Editor commands and functions are available when editing this file however, you just have the added security of not being able to execute it without having to change the settings in the Properties window.

 

Defining individual settings for project SQL files

1.In the Project window, select an SQL file in the SQL folder.
2.In the Properties window, select the data source that you want to assign to the file from the Data Source field. Active data sources are highlighted in the Properties window as well as in the Data Source drop-down list.
3.If required (e.g., because the SQL file includes target keywords), choose either "Semicolons" or "SQL Grammar" from the Group statements for execution with drop-down list.
4.If you want the parser to consider only statements that are delimited by semicolons, activate the SQL Editor should require semicolons check box and select the desired option from the Group statements for execution with drop-down list.

 

If you have defined properties for the different folders in the Project window, any file that you add to your project will inherit these properties from its parent folder. You can change the properties for a file at any time. DatabaseSpy displays properties that deviate from the parent folder's values in bold type. Once you have changed a property of a file, the link between the file's property and its parent folder's property is broken and will also not be restored by choosing the identical value in the file's drop-down list. You can, however, restore the folder-file connection by using  the respective command in the context menu.

 

Defining individual settings of a file opened in the SQL Editor

1.In the SQL Editor, click the tab of the SQL file whose properties you want to define or change. The file settings are displayed in the Properties window.
2.Change the settings according to your needs by double-clicking the Data Source or Root Object field in the Properties window and choosing an option from the drop-down list.
3.If required (e.g., because the SQL file includes target keywords) choose either "Semicolons" or "SQL Grammar" from the Group statements for execution with drop-down list.
4.If you want the parser to consider only statements that are delimited by semicolons, activate the SQL Editor should require semicolons check box and choose the appropriate option from the Group statements for execution with drop-down list.
5.Save the SQL file.

© 2019 Altova GmbH