Macro Variable TYPE, and a quiz

UDA
Enthusiast

Macro Variable TYPE, and a quiz

Hi,

How pass string like 'va', 'vb', 'vc' as one input?

Say the code like this

create macro macro_name (input_name input_type) as (
select columns
from table_x
where table_x.column_y in (:inputname)
group by 1,2 order by 1,2;
)

execute macro_name (how-to-pass);

2 REPLIES
Enthusiast

Re: Macro Variable TYPE, and a quiz

what are the input_type and how-to-pass there?

Thanks a ton.
Enthusiast

Re: Macro Variable TYPE, and a quiz


use varchar(255), and format the all the variables into one string passed to macro.

Do you want to consturct a dynamic query? Store procedure can achieve the goal.