parametrizing ORDER BY in PL/SQL (oracle 8.0.5)
From: Thomas Malmberg <thomas.malmberg_at_terranova.fi>
Date: 1999/12/22
Message-ID: <38609701.DB6DD38A_at_terranova.fi>#1/1
Date: 1999/12/22
Message-ID: <38609701.DB6DD38A_at_terranova.fi>#1/1
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
rc foobar_curtype;
)
IS
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 - 00:00:00 CET