Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 04 Feb 2014 @ 08:51:43 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: 1:1 Views - Sel * from Table OR SELECT all columns from table
 
From:   Bodla, Sravan Kumar

Hi all,

I have got the answer. I have just created a table and 2 views and came to below conclusion.

Regarding the view creation, both 'sel * from view version' and 'sel (col1, col2 ....)' are almost one and the same, both gets failed when a column is added/dropped in a base table.

In both the cases, view selects/registers the columns during the creation itself. The resolution of columns into view occurs during creation time.

The view doesn't pick the columns from the table during runtime.

So, when a column is added/dropped in the base table, both the views gets failed.

Difference/Conclusion:

But, there will be a wrong assumption, by seeing the statement ?sel * from in a view, that, the columns/data? will be selected from the table during runtime.

And we may be under wrong impression that, view refresh is not needed when a table gets altered (add/drop columns).

We may not notice this and might not refresh our views when columns are added/dropped from base table.

If we create the views using 2nd procedure (listing all columns), whenever a column is added/dropped in a table, we will have an idea to modify the underlying views.

We can make it as a standard practice that, whenever a table is modified, the views needs to be modified accordingly.

Hope this will only be useful when we send it clients and not in Forums. :-)


Thanks,

Sravan.

SRAVAN KUMAR BODLA
GCC International - Technical Consultant



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023