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: John Russell <johnrussell10_at_home.com>
Date: Tue, 30 Jan 2001 22:28:16 GMT
Message-ID: <3a773f6b.54946922@news>

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 Tue Jan 30 2001 - 16:28:16 CST

Original text of this message

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