Conditional Order clause

Conditional Order clause

 

  

( Oracle pl/sql)

Guys,
I have a pl/sql report, but i want to be able to just pass a variable in
order to determine the Ordering.
Is this possible

Here is an example.


For my_records in (Select column1, column2, column3, column4, column5
from table1
where table1.column1 = 'Req1'
and table1.column4 = 'Req2'
Order by column2)
loop
print results;
end loop;

I want to be able to order by Column1, column 2 or Column 5 depending on
what variable is passed.

Oracle LazyDBA home page