Subject | Re: [IBO] Adding OR condition to where clause |
---|---|
Author | Andreas Pohl |
Post date | 2001-05-07T14:35:45Z |
Jason,
in an abstract form I would describe my problem as following:
select * from table where condition_A=1
condition_A is set by an IBO search criteria.
I 've to expand where clause:
select * from table where (condition_A=1) or exists(select * from table
where condition_A and condition_B))
There is a table with a treenode structure
Nr , ParentNode, Name etc.
1, 0 , "1.Item"
2, 1 , "1.Item's sub item"
...
If user is searching for name that fits row 2 then row 1 should be
displayed, too, because it is the parent of row 2 (in fact condition_B of my
example query is an is_parent() udf).
I need to add my "or" expression based on actual search criteria. Is it
feasible?
Mit freundlichem Gruss & Best Regards
Andreas Pohl
apohl@...
www.ibp-consult.com
in an abstract form I would describe my problem as following:
select * from table where condition_A=1
condition_A is set by an IBO search criteria.
I 've to expand where clause:
select * from table where (condition_A=1) or exists(select * from table
where condition_A and condition_B))
There is a table with a treenode structure
Nr , ParentNode, Name etc.
1, 0 , "1.Item"
2, 1 , "1.Item's sub item"
...
If user is searching for name that fits row 2 then row 1 should be
displayed, too, because it is the parent of row 2 (in fact condition_B of my
example query is an is_parent() udf).
I need to add my "or" expression based on actual search criteria. Is it
feasible?
Mit freundlichem Gruss & Best Regards
Andreas Pohl
apohl@...
www.ibp-consult.com
----- Original Message -----
From: "Jason Wharton" <jwharton@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, May 07, 2001 3:01 PM
Subject: Re: [IBO] Adding OR condition to where clause
> Andreas,
>
> Sorry I didn't get to this sooner.
>
> Actually, SQLWhereItems supports placing OR in it. You also have to add in
> parenthesis.
>
> The trick to it is, coordinating the search criteria and knowing how to
> assemble it all.
>
> I think you will need to show me a case and then I'll show you how to use
> SQLWhereItems and then you can probably work to a full solution once your
> understanding is in full.
>
> Let me know.
>
> Jason Wharton
> > According to IBO help and my experiences SQLWhereItems and original
where
> > stuff (like search criterias) are always connected with AND. That might
be
> > true in most cases. But I need to "soften" users search criterias
without
> > losing IBO's in-form-searching-capabilities.
> >
> > I would suggest to modify parsing algorithm in that way, that IBO omits
to
> > add AND operator in case of first line of SQLWhereItems is OR or AND.
> Jason,
> > is there a way to support necessarily modifications made by me?
> >