View creation.

Database
Enthusiast

View creation.

Hi,

In one of our project it is been told to create a view for a table even if we are not accessing the view.

It is just a simple view as "Relace view as Select *from Table"

Is creating this advisable just for the sake of process? What would be it cons?

Thanks

Sunny

3 REPLIES
Junior Supporter

Re: View creation.

Hi.

It is advisable to implement a layer of views upon the tables layer, tables shouldn't be accessed directly by users by no means (other than users for loading processes plus some 'superuser' for administrator tasks). This is the Teradata advocated architecture.

BTW: 'CREATE VIEW AS SELECT * ' should be avoided, explicit column names is a much better approach.

Cheers.

Carlos.

Enthusiast

Re: View creation.

Hi Sunny

Having a view layer on top of your base tables is always advisable for security purposes.

Just because you asked for the cons : It do add some work for the developer like refeshing view definition whenever table structure changes. This require more time for impact analysis if views are not properly documented. (but this is no disadvantage)

However directly pulling data from base table is not the preferred manner.

Thanks

Nitin

Enthusiast

Re: View creation.

It is necessary to have a view layer in TD with locking row for access. Your code does not have that. It may create lock contention when more than one users want to access same table uisng the view.