Create and Modify Views

 

SQL4X Manager J includes an intelligent assistant to create and modify views for Oracle, MS SQL Server, Sybase and PostgreSQL database servers.

Create Views

 

Select your view owner

Each view has to be owned by an user in your database system. To create a view open the Database Navigator, select your database connection, catalog/schema, open the Corner Menu from the Object list and select "Create View...".

     
 

Specify your view name and SQL Query

To create a new view specify the name of the view in the View Name field and the Select statement for the view in the View Select Statement field.

If you want to test your query before creating the view click the Preview button. This runs your query in a SQL Viewer window and shows the result in a table view. Please keep in mind that not all options supported with the Preview can be used in views. For instance the "order by" option to the select command is not allowed in view definitions.

To create the view click the "Create View" button.

Display the newly created view with Database Navigator

If you have created the view it is not instantly displayed with the Database Navigator. You have to reload the view list by selecting "Reload" from the Corner Menu of the Object or Content list. After the reload your view is displayed and can be selected for execution.

 

Modify Views

To modify views the assistant reads your database servers data dictionary or catalog to retrieve the source code of an existing view. This makes it easy to modify the source code of an existing view and replace it with an altered or completely modified view.

 

Select your view

To modify a view open the Database Navigator, select your database connection, catalog/schema and view. Now open the Corner Menu from the Content list and select "Modify View...".

     
 

Specify your new SQL Query

The View Assistant displays your current view definition. Modify the displayed SQL Query and click "Update View". This will drop your old view definition and create a view with the new definition.

Attention: If your new view definition your old view will be dropped, but no new view can be created. Please double-check your SQL Query before you click "Update View".