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: cursor :can you pass order-by as parameter?

Re: cursor :can you pass order-by as parameter?

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 31 Mar 2004 12:52:11 -0600
Message-ID: <uad1wam3d.fsf@standardandpoors.com>


On Wed, 31 Mar 2004, burnunit_at_DROPTHIS.hotmail.com wrote:

> Does anyone know how to dynamically specify the order by clause
> within a cursor?

We solved it by sending in the order by column and then putting the following in the order by clause.

    ORDER BY CASE v_sort_column

               WHEN 'A_BND_ID_ASC' THEN bnd_id
               ELSE NULL
             END ASC
           , CASE v_sort_column
               WHEN 'A_BND_ID_DESC' THEN bnd_id
               ELSE NULL
             END DESC
                [...]

-- 
Galen Boyer
Received on Wed Mar 31 2004 - 12:52:11 CST

Original text of this message

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