doing a select distinct

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

doing a select distinct

Rupinder Singh Mazara
hi all

  how can i carry out a "select distinct status_id from order_header
order by status_id "
 via the delegator !

 thanks


Reply | Threaded
Open this post in threaded view
|

Re: doing a select distinct

Alexandre Gomes-5
Hi Rupinder,

   Something like this executed from a beanshell file will bring the
distinct statusIds from the OrderHeader entity.

    orderBy = UtilMisc.toList("statusId");
    findOpts = new EntityFindOptions();
    findOpts.setDistinct();
    fieldsToSelect = UtilMisc.toList("statusId");
    exprs.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, null));
    condition = new EntityConditionList(exprs, EntityOperator.AND);
    statusList = delegator.findByCondition("OrderHeader", condition,
null, fieldToSelect, orderBy, findOpts);

   Regards,
Alexandre Gomes

On 6/28/06, Rupinder Singh Mazara <[hidden email]> wrote:

> hi all
>
>   how can i carry out a "select distinct status_id from order_header
> order by status_id "
>  via the delegator !
>
>  thanks
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: doing a select distinct

Arnd Scharpegge-2
In reply to this post by Rupinder Singh Mazara
You can use one of those 'resultList = delegator.findByXX' (XX = one of
the many methods) and for the distinct, you should refer to
http://www.opensourcestrategies.com/ofbiz/ofbiz_entity_cookbook.txt 
(description at the bottom).


Arnd Scharpegge


Agrenon GmbH a member of Lynx Consulting Group,
Johanniskirchplatz 6, D-33615 Bielefeld, Germany





Rupinder Singh Mazara <[hidden email]>
28.06.2006 18:36
Please respond to
[hidden email]


To
[hidden email]
cc

Subject
doing a select distinct






hi all

  how can i carry out a "select distinct status_id from order_header
order by status_id "
 via the delegator !

 thanks