how to get this order by working in oracle pl/sql
ORDER BY CASE WHEN v_SORT_TYPE = 'ASC' THEN CASE WHEN v_SORT_ORDER = 'lname' THEN CAST(lname AS VARCHAR2(45)) || ',' || ROWNUM WHEN v_SORT_ORDER = 'code' THEN CAST(code AS VARCHAR2(52)) || ',' || ROWNUM END ASC WHEN v_SORT_TYPE = 'DSC' THEN CASE WHEN v_SORT_ORDER = 'lname' ...