Can a macro take a list as an argument?

Database

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!
Tags (1)
2 REPLIES

Re: Can a macro take a list as an argument?

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

Re: Can a macro take a list as an argument?

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