Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 04 Feb 2014 @ 16:37:58 GMT


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


Subj:   Re: 1:1 Views - Sel * from Table OR SELECT all columns from table
 
From:   Dave Wellman

Hi all,

(For Andy Schroter), what you've read is not true - certainly not on current releases.

Assume that you have a table with columns C1, C2 and C3.

You define a view on the table as "SELECT *" or "SELECT all columns by name"

Your query is "SELECT C1, C2 FROM view"

Only columns C1 and C2 will be placed into spool.

A couple of thoughts on this subject.

Personally, I always recommend against defining views as "select *". There is no difference in performance etc, but trying to diagnose problems when you've got views like that just takes a bit extra time and there have been many times when I've come across people who have got very confused by this.

IMHO this definition is someone just being lazy. It is fairly easy to write a BTEQ script or stored proc to generate the view definition with each column named.

If you use "select *" then any time someone issues a "SHOW VIEW" command all you'll see is exactly that. Yes, you can issue HELP VIEW or use DBC.COLUMNSV and that may work for you.

Whichever approach you take adding columns to the underlying table will not break the view. Only removing columns or renaming them will cause the view to break.


Cheers,

Dave

Ward Analytics Ltd - Information in motion (www.ward-analytics.com)



     
  <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