Creating regular views

When you create a regular view, the database server stores the view definition in the database; no data is stored for the view. Instead, the view definition is executed only when it is referenced, and only for the duration of time that the view is in use. This means that creating a view does not require storing duplicate data in the database.

To create a new regular view (Sybase Central)

  1. Connect to the database as a user with DBA authority.

  2. In the left pane, right-click Views and choose New » View.

  3. Follow the instructions in the Create View Wizard.

  4. In the right pane, click the SQL tab to edit the view definition. To save your changes, choose File » Save.

To create a new regular view (SQL)

  1. Connect to a database.

  2. Execute a CREATE VIEW statement.

Example

Create a view called DepartmentSize that contains the results of the SELECT statement given earlier in this section:

CREATE VIEW DepartmentSize AS
   SELECT DepartmentID, COUNT(*)
   FROM Employees
   GROUP BY DepartmentID;

See CREATE VIEW statement.