Dynamic "Orde by" parameter in Oracle Stored procedure

From: Amritha <amritha.datta_at_gmail.com>
Date: Mon, 16 Aug 2010 11:51:34 -0700 (PDT)
Message-ID: <9a93ad9b-baa1-4698-84e4-8bfac46bf546_at_n35g2000vbl.googlegroups.com>



Hi,

I would like to execute a SELECT * from table1 order by <XYZ> and get the results into IN OUT cursor.

I want to pass XYZ as input parameter to stored procedure. It is treating it as string.

For example: if XYZ value is field1, it is executing the SQL statement as
SELECT * from table1 order by 'field1'
instead of
SELECT * from table1 order by field1

Please help. Received on Mon Aug 16 2010 - 13:51:34 CDT

Original text of this message