Filtering [message #2924] |
Thu, 22 August 2002 06:41 |
MathewMcloughlin
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
ive managed to set up a variable in my data set SQL
select a.*,a.rowid
from analysis a
where (TIME_RECEIVED-TIME_TAKEN)<:no_of_days
I have also declared it, and can change it using the variables box in Object Inspector. This all works fine and it does filter the table down like I want it.
However I need to be able to change the variable from within the program. Apparently the line of code to use is
DataModuleMain.OracleDataSetAnalysis.setVariable('NO_OF_DAYS','10');
When I compile the program it doesn't give any errors although it also doesnt do anything when I run this line of code (click of a button). Do I have to activate it or similar
or am I going totally down the wrong road.
thanks
Mathew
|
|
|
Re: Filtering [message #2930 is a reply to message #2924] |
Thu, 22 August 2002 09:30 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
Mathew, this question is more appropriate for a Delphi forum, but your SQL looks fine. I'm going to guess that you are using Direct Oracle Access here by the SetVariable reference.
First off, make sure the variable is set to an Integer datatype (instead of String) in the Variables dialog. Then, in the SetVariable call, just pass in 10 instead of '10'.
Of course, you need to set DataSet.Active := True after setting the variable value to actually execute the query.
|
|
|