Subject | Re: What is a view |
---|---|
Author | Adam |
Post date | 2005-06-30T12:15:32Z |
A view is a virtual table based on a query.
There are a number of reasons you might use them. For example, you
could have a long conversation with someone writing your reports for
you about your schema, or you could stuff that, and write a view to
return the fields they need joining tables in an efficient manner.
You might not want to let people access every record in a table (for
security reasons), so you could create a view to return a subset of
rows and provide them access to this.
You might have a salary table for the employees of a company, but you
don't want to let supervisors see their bosses salary. You could
implement this using a view.
I suggest you read the IB6 docs (download them from IBPhoenix), there
is one about designing a database that I am sure will cover views in
good detail.
A word of warning!!!
There is no "alter view" syntax, so never create a view that is based
on another view. Otherwise you will need to write a massive script to
alter the underlying view (invitation for DB Workbench plug :) ).
Because of this restriction, I often use selectable stored procedures
instead of views.
Adam
There are a number of reasons you might use them. For example, you
could have a long conversation with someone writing your reports for
you about your schema, or you could stuff that, and write a view to
return the fields they need joining tables in an efficient manner.
You might not want to let people access every record in a table (for
security reasons), so you could create a view to return a subset of
rows and provide them access to this.
You might have a salary table for the employees of a company, but you
don't want to let supervisors see their bosses salary. You could
implement this using a view.
I suggest you read the IB6 docs (download them from IBPhoenix), there
is one about designing a database that I am sure will cover views in
good detail.
A word of warning!!!
There is no "alter view" syntax, so never create a view that is based
on another view. Otherwise you will need to write a massive script to
alter the underlying view (invitation for DB Workbench plug :) ).
Because of this restriction, I often use selectable stored procedures
instead of views.
Adam