![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 05 Jan 2005 @ 11:47:40 GMT
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
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||