Setting a query parameter
Greetings. I attended the ColumbusEgg4Delphi webinar and was impressed. I'm starting to look at incorporating it into my applications and I have a newbie question: how would I incorporate setting a query parameter into the ColumbusModule attached to a dataset?
Example: suppose I want to count the records (or derive some other aggregate function) satisfying a particular condition (similar to the CalcCaliforniaPersons example given in the ColumbusPrimer example) but I don't want to just loop through the dataset one record at a time -- there may be many many records. Ordinarily I would build a query like SELECT COUNT(*) FROM MyDataSet WHERE ConditionValue = :Value; and then set ParamByName('Value').Value as desired. But ColumbusModule doesn't know whether my DataSet is a query and so has no way of setting a parameter value.
I could typecast the DataSet in my ColumbusModule as a query type, but that would mean goodbye to loose coupling. It looks to me like my best approach may be to define a procedure in the ColumbusModule -- call it SetConditionValue -- and link it to a procedure in my data module or form that operates on the query. Am I on the right track? Or should I be triggering this through a Listener?