Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 21 Feb 2012 @ 15:22:50 GMT


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


Subj:   Executing query stored in a table through BTEQ
 
From:   debojit.pal

Hi,

I have this requirement of executing SQL query stored in a table.

E.g. - Here is the table layout -

        Col1      Col2

     1. sel * from dbc.tables where tablename = 'abc';

     2. sel * from dbc.tables where tablename = 'xyz';

Now, depending on the value of Col1, I would like to execute either the 1st query or the 2nd one. So I would write -

     Sel Col2 from sample_table where col1 = 1;

This would return -

     sel * from dbc.tables where tablename = 'abc';

as a text in the bteq outfile.

But I would like this text to be executed so that it returns a result.

I know this can be done through stored procedures but our installation does not give us access to run stored procedures.

I am using UNIX to connect to Teradata.

Any help would be greatly appreciated.


Thanks,

Debojit.



     
  <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: 27 Dec 2016