Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 13 May 2011 @ 09:06:10 GMT


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


Subj:   Re: Use case statement to select the desired table
 
From:   DWellman

Hi,

As Mike said, this isn't possible in 'raw SQL'.

But as you said that you need to maintain a 'single program' then you'd typically do this in the program code. When the code is building the SQL (plugging in date ranges, other variables for the WHERE clause etc) then also plug in the schema name.

Another alternative may be to get this work done in a stored procedure (I'm fairly certain you can do this there). An SP will allow you to change the schema name at run time. I think that even if the column list being returned is different you can do this with dynamic SQL in the SP.


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