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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie Question - Sorting Records

Re: Newbie Question - Sorting Records

From: Marien Kaptein <M.Kaptein_at_Optimit.nl>
Date: Fri, 14 Aug 1998 12:43:45 +0200
Message-ID: <6r141q$5ls@tuegate.tue.nl>


You could try to add an order by clause to the cursor's SQL using the decode function:
order by decode(1,1,2,2,4,3,3,4,7,5,5,6,6,7)

Marien Kaptein

Nick Lehane wrote in message
<01bdc510$d01927a0$eb58ea9e_at_ukp016543.logica.co.uk>...
>Hi everyone,
>
>I am currently interrogating several tables by defining my SQL as a cursor
>and populating text fields with the results (these text fields are not
>connected to a base table).
>
>My problem is that I have to offer the user the option to display records
>in a particular order according to the values of one field, in the order
>1,2,4,3,7,5,6. This display is the default for the form. What would be
>the best way to sort the records into this order? I initially sort them by
>ascending order, then I suppose I would have to swap round the anomalous
>ones (ie those with the field values of 4 and 7 since the others are in
>ascending order...)
>
>Would it be best to implement this by assigning the results of each
>iteration of the cursor loop to a record group? Any suggestions please?
>
>Many thanks in advance,
>
>Nick Lehane
Received on Fri Aug 14 1998 - 05:43:45 CDT

Original text of this message

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