Re: parametrizing ORDER BY in PL/SQL (oracle 8.0.5)

From: Hoang-Vu PHUNG <hoang-vu_at_freesurf.ch>
Date: Wed, 22 Dec 1999 11:30:25 +0100
Message-ID: <83q998$aev$1_at_news1.sunrise.ch>


Try dynamic sql.See the package dbms_sql.

Thomas Malmberg <thomas.malmberg_at_terranova.fi> wrote in message news:38609701.DB6DD38A_at_terranova.fi...
> Hi,
>
> 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 - 11:30:25 CET

Original text of this message