Order by [message #284260] |
Thu, 29 November 2007 04:33  |
kuwait
Messages: 55 Registered: October 2007
|
Member |
|
|
Hi all,
I have a problem in ordering a block by using order by statement
I want to order a data block according to the field trnamea
I used order by and run the form it is still miss ordered as if no order by there
this is my code I've written it in the post-query of the data block crsinvoiced:
begin
select decode(a.trnamea, '',b.titlee||a.trnamee, b.titlea||a.trnamea)
into :crsinvoiced.namea
from ads.trainees a, ads.title b
where a.trno=:crsinvoiced.custid
and a.tid=b.titleid
order by trnamea asc; --This the order by that is not working
exception
when others then
null;
end;
Please can you help?
Thanx
|
|
|
Re: Order by [message #284275 is a reply to message #284260] |
Thu, 29 November 2007 05:09   |
scorpio_biker
Messages: 154 Registered: November 2005 Location: Kent, England
|
Senior Member |
|
|
Hi,
You say this code is in a post query trigger? If you are trying to order the block you probably need to put the order by on the query specified for the block.
|
|
|
|
Re: Order by [message #285007 is a reply to message #284283] |
Mon, 03 December 2007 01:59   |
kuwait
Messages: 55 Registered: October 2007
|
Member |
|
|
Hello thanks for ur replies,
I've tried to set the property order by trnamea but it cannot be done it gives me ORA-00904: invalid column name, because trnamea is not defined for that data block it's in another table which is trainees that is related to the data block I want to order by (trno=custid), so that I used a post query but as I said before it's not working it execute the records miss-ordered for trnamea but ordered for custid.
Regards
|
|
|
|
Re: Order by [message #285027 is a reply to message #284260] |
Mon, 03 December 2007 02:39   |
kuwait
Messages: 55 Registered: October 2007
|
Member |
|
|
Thanks Littlefoot
I've already made the join a.trno=:crsinvoiced.custid in the post query and it's working fine just I want to order it, I think there's a way rather than making a view
begin
select decode(a.trnamea, '',b.titlee||a.trnamee, b.titlea||a.trnamea)
into :crsinvoiced.namea
from ads.trainees a, ads.title b
where a.trno=:crsinvoiced.custid --This is the join condition it's working fine
and a.tid=b.titleid
order by trnamea asc; --This the order by that is not working
exception
when others then
null;
end;
Thanx
|
|
|
|
|
|
|
|
|
|
|
|
Re: Order by [message #285278 is a reply to message #285274] |
Tue, 04 December 2007 03:31  |
kuwait
Messages: 55 Registered: October 2007
|
Member |
|
|
You are right Littlefoot worst but it's working, we'll live with it if somthing goes wrong in the future I'll restore the old one.
Thanks
|
|
|