You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Craig A. Vanderborgh" <cr...@voxware.com> on 2004/02/13 20:01:23 UTC

Help needed w/OQL Query

Hello Everyone:

We are using OJB with great success, and I would first like to thank the
OJB team for such a terrific product.

We are using OJB rc5, and the ODMG API.  I have a functioning OQL query
that looks like this:

 OQLQuery query = odmg.newOQLQuery();
 query.create("select picks from " + Pick.class.getName() + 
         " where pickListId = $1 and status = $2 order by nextId asc");
 query.bind(pickListId);
 query.bind(new String("D"));
 DList results = (DList) query.execute();

We would like to alter this query so that instead of just 
"and status = $2" 

we had something like 

"and (status = $2 || status = $3)"

The problem is that I have been unable to find any OQL documentation
that indicates how one might do this sort of thing.  We would very much
appreciate some advice on this.

If nothing else, please give us a pointer to the best OQL documentation
you are aware of, as what we have found thus far is very limited.

TIA,
craig vanderborgh
voxware incorporated





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Help needed w/OQL Query

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi craig,

if '||' is meant to be an 'or' in your case the try
... and (status = $2 or status = $3)

jakob

Craig A. Vanderborgh wrote:

> Hello Everyone:
> 
> We are using OJB with great success, and I would first like to thank the
> OJB team for such a terrific product.
> 
> We are using OJB rc5, and the ODMG API.  I have a functioning OQL query
> that looks like this:
> 
>  OQLQuery query = odmg.newOQLQuery();
>  query.create("select picks from " + Pick.class.getName() + 
>          " where pickListId = $1 and status = $2 order by nextId asc");
>  query.bind(pickListId);
>  query.bind(new String("D"));
>  DList results = (DList) query.execute();
> 
> We would like to alter this query so that instead of just 
> "and status = $2" 
> 
> we had something like 
> 
> "and (status = $2 || status = $3)"
> 
> The problem is that I have been unable to find any OQL documentation
> that indicates how one might do this sort of thing.  We would very much
> appreciate some advice on this.
> 
> If nothing else, please give us a pointer to the best OQL documentation
> you are aware of, as what we have found thus far is very limited.
> 
> TIA,
> craig vanderborgh
> voxware incorporated
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Help needed w/OQL Query

Posted by Sukesh Garg <sg...@codaware.com>.
you could try 

  OQLQuery query = odmg.newOQLQuery();
  query.create("select picks from " + Pick.class.getName() + 
          " where pickListId = $1 and (status = $2 or status = $3) order by nextId asc");
  query.bind(pickListId);
  query.bind(new String("D"));
  query.bind(new String("E"));
  DList results = (DList) query.execute();

refer to...

http://db.apache.org/ojb/query.html

hth
-aukesh

On Fri, 2004-02-13 at 11:01, Craig A. Vanderborgh wrote:
> Hello Everyone:
> 
> We are using OJB with great success, and I would first like to thank the
> OJB team for such a terrific product.
> 
> We are using OJB rc5, and the ODMG API.  I have a functioning OQL query
> that looks like this:
> 
>  OQLQuery query = odmg.newOQLQuery();
>  query.create("select picks from " + Pick.class.getName() + 
>          " where pickListId = $1 and status = $2 order by nextId asc");
>  query.bind(pickListId);
>  query.bind(new String("D"));
>  DList results = (DList) query.execute();
> 
> We would like to alter this query so that instead of just 
> "and status = $2" 
> 
> we had something like 
> 
> "and (status = $2 || status = $3)"
> 
> The problem is that I have been unable to find any OQL documentation
> that indicates how one might do this sort of thing.  We would very much
> appreciate some advice on this.
> 
> If nothing else, please give us a pointer to the best OQL documentation
> you are aware of, as what we have found thus far is very limited.
> 
> TIA,
> craig vanderborgh
> voxware incorporated
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org