I'm declaring an explicit cursor, however, I need to order the sql differently depending on user interaction. The column to order by is passed to the procedure as a parameter, however, I'm having difficulty incorporating it into the sql for the cursor (as near as I can tell, it is interpreting the variable name as the name of the column and thus ordering by nothing.
Is there a way to use a locally declared variable in an explicit cursor statement?
Here's a basic skeleton of what I'm attempting thus far:
v_order_by varchar2(100) := <function that grabs URL param>
c_cursor is
select...
.
.
.
order by v_order_by;
Any help is greatly appreciated. All the examples of using explicit cursors I've found so far are entirely unhelpful.