Chapter 3 Building Physical Diagrams


View columns

The Columns page in a view property sheet displays the list of columns in the view. This list of columns reflects the SELECT orders from the queries of the current view. The only way to add or remove columns from this list is to modify the query of the view.

For more information on how to define the query of a view, see section Defining a query for a view.

If the view was created from one or several tables or views The name, code, description and data type of the view column are those of the corresponding column in the linked table or view.

If the view is user-defined It implies the view is not linked to another object. The name and code of the view column comes from the column name in the first query in the view definition. For example, MyView is defined by the following queries:

select Name, Comment
from Property
union
select Signature, Body
from Method

Only the two columns of the first query are used to create the corresponding view columns:


In this case, if you modify the view column code, the view creation script will reflect the change. In our example, if you rename Name in ClientName, the view creation script is the following:

create view MYVIEW (ClientName, "Comment") as
select Name, Comment
from Property

View column properties

When you select a column in the list of view columns and click the Properties tool in the toolbar, the view column property sheet appears. You can define the following properties from the view column property sheet:

Property Description
Name Name of the view column. This name is automatically calculated. If you choose to modify the default name, the User-defined button is selected and the Custom Name column displays the user-defined name. You can recover the default name by clicking again the User-defined button
Code Code of the view column. The code is automatically calculated. If you choose to modify the default code, the User-defined button is selected and the Custom Code column displays the user-defined code. You can recover the default code by clicking again the User-defined button
Comment Comment of the view column. This comment is automatically calculated from the column comment in the original table or view. If you choose to modify the default comment, the User-defined button is selected. You can recover the default comment by clicking again the User-defined button
Stereotype View column stereotype
Data Type View column data type. This data type is automatically calculated from the column data type in the original table or view. If you choose to modify the default data type, the User-defined button is selected. You can recover the default data type by clicking again the User-defined button
Length Maximum length of the data type
Precision Maximum number of places after the decimal point

You can also define notes and business rules on a view column.

User-defined name or code

You can modify the name and the code of a view column from the list. If you need to recover the name or code default value, you have to clear the corresponding cell in the list, the default name or code is automatically restored.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.