The IBM® Database Add-Ins for Visual Studio
simplify the process of creating database views.
You can use one of the following tools to create an IBM database view:
The IBM View Designer, with which you can generate a
view and save it to an IBM database that has a data
connection in the Server Explorer.
The Visual Studio Code Editor, with which you can manually insert
the SQL statement in the view script file in an IBM
database project in the Solution Explorer.
With the designer, you provide information about
the view, specify the CREATE VIEW SQL statement, and specify
script options for the view. You also can
specify triggers and access privileges for the view.
To create a view by using the designer:
In the Server Explorer, right-click Views under your
data connection, and then select Add New View with Designer on the
shortcut menu.
The IBM View Designer opens.
Use the designer views to define the SQL condition,
triggers, and access privileges for your database view.
For detailed information about fields in the designer views, see
IBM View Designer.
Save the view definition. From the File menu, select Save
[view name].
The view definition script is run against the database
and the view is created.
Close the designer.
To create a view by using the editor:
In the Solution Explorer, right-click the Views folder
under your IBM database project, select Add, and then select
New Item on the shortcut menu.
The Add New Item window opens.
In the Categories list, select the Views folder.
In the Templates list, select View Script.
In the Name field, type a name for the new view file,
then click Add.
A new view file with a basic structure is created and added
to your project.
Use the editor to make changes to the view.
To save your changes, perform one of the following actions:
To save the view with its default file name, from the
File menu, select Save [file name].
To save the view with another name, from the File
menu, select Save [file name] As, type a new
name for the view file in the Save File As window,
and then click Save.