Global SQL Statements

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

Home >  Altova Global Resources > Using Global Resources >

Global SQL Statements

SQL statements that have been saved as *.SQL files can be used as file-type global resources in DatabaseSpy. For example, if you use a development and a production database with different names and/or location, you would need two different SQL statements to query the currently active database. By defining these SQL statements as global resources, you can not only switch between the two databases with a mouse click, but also have the corresponding SQL query displayed in the SQL Editor. All you have to do, is to synchronize the SQL Editor with the data source and execute the query.

 

Displaying file-type global resources in the SQL Editor

File-type global resources can be viewed, edited, and executed like any other SQL in the SQL Editor. When clicking the View button in the Manage Global Resources dialog, the file is displayed in the SQL Editor in the background and the Manage Global Resources dialog remains open so that you can edit or delete the global resource, if required.

dlg_glob-res-view-SQL

Alternatively you can also use the File menu to open a global resource.

 

To display a file-type global resource in the SQL Editor:

1.Select the menu option File | Open Global Resource... to display the Choose Global Resource dialog box.
2.Select a file-type global resource under the Files directory and click OK. The file is displayed under its Alias name in a new SQL Editor window.

 

Alternatively, do the following:

 

1.Select the menu option Tools | Global Resources... or click the Manage Global Resources ic_manage-global-resources toolbar button to open the Manage Global Resources dialog.
2.In the Files folder, select the Alias name of the SQL file you want to display and click the View button.
3.Click Cancel to close the Manage Global Resources dialog.

© 2019 Altova GmbH