Concatenation in Macro

Database
Enthusiast

Concatenation in Macro


I am writing a macro with a parameter and I need to concatenate this parameter as where condition for the select statement in the macro.

Create macro mymacro (whereCondition varchar(100)) As
(

select myno,myname,myaddress from mytable where ||' '|| :whereCondition;

);

this is giving error

3706: Syntax error: expected something between the 'where' keyword and '"||"'.
Output directed to Answerset window

if someone having it's solution please let me know...

Thanks,
1 REPLY
Enthusiast

Re: Concatenation in Macro

Hi,

Hope this helps:

create macro macro_nm(wherecond varchar(10))
as
( sel * from tbl_nm
where col_nm= :wherecond ;);