Parametizing "ORDER BY" clause of a cursor?

From: michael t hudacko <hudacko_at_bbdo.com>
Date: 16 Jul 1998 17:22:33 GMT
Message-ID: <01bdb0de$081a1fc0$8f1e2795_at_VectraVL34.bbdo.com>



[Quoted] Hi Folks!

I wrote an Oracle Webserver PL/SQL procedure that builds a four column table to return to a browser. Then I recognized the need to sort by each column within the browser. The table headers are hypertext links which call the procedure recursively, passing the column number as a parameter to the procedure. Thought this would work... it doesn't It appears that the ORDER BY clause is being ignored.

procedure ais_report (ord IN NUMBER DEFAULT 1) as

CURSOR rpt_cur (orderby number) is
select one,two,three,four from table
order by orderby;

BEGIN OPEN rpt_cur(ord);
.........

I was thinking that the ORDER BY CLAUSE will be interpreted as either: ORDER BY 1
ORDER BY 2
ORDER BY 3
ORDER BY 4
representing the four different ordering choices: fields ONE, TWO,THREE, or FOUR as illustrated in the snipet above,

[Quoted] Thanks for any feedback
hudacko_at_bbdo.com Received on Thu Jul 16 1998 - 19:22:33 CEST

Original text of this message