Default order by clause in forms
Sandy310May 21 2009 — edited May 27 2009Hi,
My form has a data block which has items based on database table and non-database
table. My question here is - where do I use order by clause so that I can have
client number item which is database column in Ascending order. If I put
Order By Client in Data block property palette it is taking too long in
executing which obviously I don't want, is there any other way to do it.
Giving more background to it earlier I used to get all clients in Asc order but yesterday new client
has been added and now I see that particular client on top irrespective of its number being 40.
I was wondering from where Oracle forms takes its default Order By clause.
My second question is my query is running little slow is there any way to tune it.here is part of it
SELECT count(*)
INTO :ORDER_STATUS.EXPEDITE
FROM orders o,shipment_type_methods stm
WHERE o.status in ('A','U')
AND (o.parent_order_id is null
OR (o.order_type = 'G'
AND o.parent_order_id = o.original_order_number))
AND o.client = stm.client
AND o.shipment_class_code = stm.shipment_class_code
AND (nvl(o.priority,'1') = '2'
OR stm.surcharge_amount <> 0)
AND o.client = :ORDER_STATUS.CLIENT_NUMBER
GROUP BY o.client;
I really appreciate your help and time.
Thanks
SANDY
Edited by: sandy162 on May 21, 2009 2:12 PM