Hi all,

I am trying to create a 'dynamic Sql' statement by using macros to
add conditions at run time according to a few criteria.

a typical macro Im using is as follows:

#localmacro.MacroName
    #ifnot.empty(%2)
        #define.ItemGroupId(%2)
        #ifnot.ItemGroupId('')
            join inventTable
                where (%4.Product == inventTable.ItemId)
                && (inventTable.ItemGroupId == %2)
        #endif
    #endif
#endmacro

sql statement would be as follows:

while select tablename
where <conditions>
#MacroName
{
  do something.
}

I am expecting the macro to concatenate the 'join' part only if the
second parameter passed to the macro is not null, ie an empty string.
The problems lie in that the join part is always being added the X++
sql statement. Is there someone who has comprehensive experience
using macros?

John Chircop,
Malta.







SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to