parametrizing ORDER BY in PL/SQL (oracle 8.0.5)

From: Thomas Malmberg <thomas.malmberg_at_terranova.fi>
Date: Wed, 22 Dec 1999 09:23:01 GMT
Message-ID: <38609701.DB6DD38A_at_terranova.fi>



Hi,

[Quoted] [Quoted] I'm trying to ORDER BY my query using a in-parameter. As we all know it is possible to ORDER BY using a column index. Can this index be passed as a parameter.

Example function that compiles but still doesn't order by the parameter - instead it orders by column 1:

   FUNCTION getfoobar (

      inorderby IN NUMBER
   )

      RETURN foobar_curtype
   IS

      rc foobar_curtype;
   BEGIN

      OPEN rc FOR
         SELECT f.name, f.address, f.phone, f.department
           FROM footable f
          ORDER BY inorderby ASC;
      RETURN rc;

   END; Received on Wed Dec 22 1999 - 10:23:01 CET

Original text of this message