Page 1 of 1

Regarding Macros in SDAC.

Posted: Mon 15 Jan 2007 07:41
by eprince
Hi guyz,
Recently i encountered a situation where i need to use conditional query building using the (#If - #EndIf) syntax.
e.g. :
SELECT
FROM
WHERE
#if (&MacroName = )

#endif
Order by


Where value of the macro 'MacroName' is passed through inline code.

But I was not able to execute this Query as (#If - #EndIf) is not supported by SDAC

Can some one kindly suggest me what is the work-around for this?

Posted: Mon 15 Jan 2007 14:02
by Jackson
SDAC doesn't support such functionality.
You can modify your query like the following:

Code: Select all

SELECT  FROM  
WHERE  
&MacroName
Order by  
then assign the following value to this macros:

Code: Select all

MSQuery1.MacroByName('MacroName').Value := '';
and just turn it off or on depending on your conditions:

Code: Select all

MSQuery1.MacroByName('MacroName').Active := IsMacrosValueNeeds;