Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 13 May 2011 @ 06:30:45 GMT

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

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

<-- Anonymously Posted: Thursday, May 12, 2011 21:25 PM -->


I need to access the "patient" table that may resides in different schema depending on the region I need to pull the information from. For example, northern california will be hcclnc_tpf.patient, southern california will be hcclsc_tpf.patient, and Hawaii will be hcclhi.patient. I need to maintain one single program which will allow me the flexibility to call upon different schema depending on the database I log in. Is that possible to do in Teradata SQL Assistant?

     Select *
     from xxxxxx.patient;

If the database name is Northern California, that xxxxxx = hcclnc_tfp; If the database name is Southern California, that xxxxxx = hcclsc_tfp; If the database name is Hawaii, that xxxxxx = hcclhi;

  <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