All Forums Database
iamlevis 1 post Joined 08/10
27 Aug 2010
Can a macro take a list as an argument?

Can we do the following?

exec myMacro( ('chicken','pig','cow') );

create macro mymacro ( incomingList ) AS
(
select foo

from tBar

where animal in (:incomingList );

);

Thanks!

sidukas 3 posts Joined 09/10
03 Sep 2010

no, but you can provide the string 'chicken,pig,cow' and split it in macro.

Jimm 298 posts Joined 09/07
03 Sep 2010

Or you can:
exec myMacro( ('''chicken'',''pig'',''cow''') );

You must sign in to leave a comment.