How do you add "OR" Criteria to the SQL object in code
I am trying to manipulate the SQL object in code and am successful as long
as it is an "AND" operation. What I would like to do is have the SQL object
look something like this:
WHERE ( OR )
AND
So far I have been unable to find any example of how to accomplish this,
although I can see there is a way to ad an "OR" criteria and manipulate the
"level" the of a criteria. Is their any documentation for working with the
SQL object? Can this be accomplished using and AutoSearch?
Thanks in advance for the help.
Sincerely,
Eric Hansen
eric.hansen@protelinc.com
as it is an "AND" operation. What I would like to do is have the SQL object
look something like this:
WHERE ( OR )
AND
So far I have been unable to find any example of how to accomplish this,
although I can see there is a way to ad an "OR" criteria and manipulate the
"level" the of a criteria. Is their any documentation for working with the
SQL object? Can this be accomplished using and AutoSearch?
Thanks in advance for the help.
Sincerely,
Eric Hansen
eric.hansen@protelinc.com
This discussion has been closed.
Comments
Here is an example of modifying the TdaSQL object:
http://www.digital-metaphors.com/tips/ExtractSQLObject.zip
The 'And' operator is implied. To add an Or, Begin, End to the criteria
you need to extract the TdaSQL object and then use
TdaSQL.InsertCriteria. Below is the function declaration.
function InsertCriteria(aPosition: Integer; aType: TdaCriteriaType):
TdaCriteria;
TdaCriteriaType is defined in TdaSQL.pas as
TdaCriteriaType = (dacrField, dacrOR, dacrNOT, dacrBegin, dacrEnd);
A call would look like
lSQL.InsertCriteria(0, dacrOR);
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com