Forms6i - dynamic order by clause
Hello everybody. How do I overcome next problem ?
I created procedure:
PROCEDURE GetAnalit_From_Old_IO IS
CURSOR Fill IS
SELECT distinct col1, col2
FROM table a
WHERE col1>100
ORDER BY decode(:GLOBAL.order,null,col1,:GLOBAL.order) desc;
....
and defined global variable on when-new-form-instance trigger
:GLOBAL.order :='col3';
For some reason, this doesn't work - procedure doesn't ordering fetched data. I also tried ORDER BY decode(to_char(:GLOBAL.order),null,col1,to_char(:GLOBAL.order)), but it seems that's illegal.
Please help.
Thanks in advance.