Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 30 Jul 2002 @ 03:30:46 GMT


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


Subj:   Re: Macro Possibilities?
 
From:   Narayan Murthy K S

No matter whether you are using macro's or stored procedure's you cannot have a table name being supplied as a parameter in a FROM clause!(I have tried both macro's and stored procedure's).

You could try something round about which could solve your problem. i.e Forming strings that you need to execute and then store them into a temporary table, then export them to a file and then execute them by using

".run file = xxxx" - this is subject to , if you are using BTEQ as the client.

The formation of the strings helps you supply table name in the FROM clause. For Eg:

insert into temp(
'Insert into DB.Target_Table Select col1, col2 From ' || :Source_Table||';');
.....
.export file="fileexported"
sel * from temp;
.export reset

.run file="fileexported"

For forming those strings you could make use of macro's or stored procedures ,i.e the above insert could appear in a macro or a stored procedure to which you could pass the table name as a parameter.

Well this is how i used it to overcome the issue. Hope it helps.

Narayan Murthy K S



     
  <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