This works for me:
order by case when :dir_param = 'ASC' then case :col_param when 'col_1_identifier' then col_1_name when 'col_2_identifier' then col_2_name ... end end, case when :dir_param = 'DSC' then case :col_param when 'col_1_identifier' then col_1_name when 'col_2_identifier' then col_2_name ... end end desc
or
order by case when :dir_param = 'ASC' and :col_param = 'col_1_identifier' then col_1_name end, case when :dir_param = 'DSC' and :col_param = 'col_1_identifier' then col_1_name end desc, case when :dir_param = 'ASC' and :col_param = 'col_2_identifier' then col_2_name end, case when :dir_param = 'DSC' and :col_param = 'col_2_identifier' then col_2_name end desc
Replace literals, variable names, and column names with ones that match your situation. Oracle seemed to be very selective about the definition of the desc direction classifier.
Yale madden
source share