Re: Dynamic "Orde by" parameter in Oracle Stored procedure

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Mon, 16 Aug 2010 21:07:35 +0200
Message-ID: <4c698c73$0$5279$ba620e4c_at_news.skynet.be>



Amritha wrote:
> 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.
>

I suppose you could use a ref_cursor, but what kind of design requires such construction? Received on Mon Aug 16 2010 - 14:07:35 CDT

Original text of this message