I need to create a dynamic SQL based on options selected by user. defining SQL by text I simply add the param to the sq text based on the user selection. for example:
if param1 <> '' then
SQLText := SQLText + Param1;
if param2 <> '' then
SQLText := SQLText + Param2;
....
How can i do this with Aurelius. I think this can de done using TCriteria.
I think i didnt maked my self clear with the question, beause the solution is simple and straightforward actually the sample code should have looked like this:
if AIncidencia = 'S' then TxtQry.Add('INFORMES.NOVEDAD = 1 AND ') else if AIncidencia = 'N' then TxtQry.Add('INFORMES.NOVEDAD = 0 AND ');
And I have dobe it like this:
Criteria := Manager.Find<TINFORME>; if AIncidencia = 'S' then Criteria.Add(TExpression.Eq('NOVEDED', 1)) else if AIncidencia = 'N' then Criteria.Add(TExpression.Eq('NOVEDED', 0));
I was used to use Find on the same statement for example