Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 05 Oct 2012 @ 09:20:06 GMT


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


Subj:   Stored Procedure: SELECT INTO clause
 
From:   Ravi.Singh

Hi,

Is it possible to use a local variable in FROM clause of SELECT INTO statement. I have a requirement like this,

     BEGIN
     DECLARE   vDBame    varchar(30);
     DECLARE   vClient_ID   SMALLINT;
     IF (some condition) THEN
          SET vDBName = 'XXX';
     ELSE
         SET vDBName = 'YYY'
     END IF;

     SELECT CLIENT_ID INTO :vClient_ID  FROM :vDBName.CLIENT_TABLE WHERE CLIENT_CODE = 'ABC';

     END

The SELEC INTO clause is not working out. Can anyone please help me out how to get it done.


Regards,

Ravi



     
  <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