Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sort web screen 16 different ways

Re: sort web screen 16 different ways

From: David Rawding <daverawding_at_mediaone.net>
Date: Sat, 03 Feb 2001 18:15:11 GMT
Message-ID: <k7io7tsee32u18jsi8t0ne068t5q5pogqc@4ax.com>

Well, it almost worked. I tried the decode in the cursor statement with the following results. the sort_criterion was an alpha variable and the columns were a mix of alpha, numeric, and date. The compiler wouldn't allow the date column and the numeric columns sorted just as if they were alpha (varchar2). I.E. 10, 2, 21, 300, 40, etc.

Finally gave up and added lots of code, but any idea of what happened? Again using 7.3.4 (going to 8.1.6 or 8.1.7 in 5 months).

thanks, Dave Rawding

On Tue, 30 Jan 2001 22:28:16 GMT, johnrussell10_at_home.com (John Russell) wrote:

>For sorting by arbitrary column, I like to use DECODE() in the ORDER
>BY clause. E.g.:
>
>select * from ... order by decode(sort_criterion, 1, column1, 2,
>column2, ...);
>
>Then pass the value for sort_criterion as a CGI-style parameter to the
>web page. Each column heading can be a link that passes the
>appropriate parameter.
>
>John
>
>On Tue, 30 Jan 2001 03:56:10 GMT, David Rawding
><daverawding_at_mediaone.net> wrote:
>
>>My business user wants to show 16 columns of data on a web screen with
>>each column able to be the sort field. I am using plsql in a 7.3.4
>>database to generate the web pages. I have been using cursors each
>>with a different order by clause with the same "select field1, field2,
>>etc from ..... where...." part in other screens with less sort
>>options..
>>
>>Is there a "best" way to code this so I don't have to have 16 cursors
>>all defined the same except for the order by clause and 16 if
>>statements to open the right one and 16 if statements to fetch the
>>right one and so on?
>>
>>-Dynamic dbms_sql doesn't seem too good since there are so many fields
>>to bind to.
>>-A plsql table to hold the data would still need to be sorted on the
>>right field unless there is a sort function for plsql tables.
>>
>>Any ideas?
>>
>>thanks, Dave Rawding
>>
Received on Sat Feb 03 2001 - 12:15:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US