Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Wed, 05 Jan 2005 @ 11:47:40 GMT





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




Subj:   Re: Conditional macro execution
 
From:   Agarwal, Rachana



Vivek,

You can use coalesce function to select all rows in case null is passed as argument.

Look at the 2 different examples of macros below :-

1)

     replace macro m1( name1 char(10) ) as

     (sel * from t1 where t1.name= coalesce( :name1 , t1.name) or :name1 is null ;

     )

Or another solution below

2)

     replace macro m1( name1 char(10) ) as

     (sel * from t1 where t1.name=  :name1  or :name1 is null ;
     )

Regards,

Rachana





     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008