Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> using variable name in order by

using variable name in order by

From: <geraldine_2_at_comcast.net>
Date: Tue, 22 Mar 2005 20:15:52 +0000
Message-Id: <032220052015.13328.42407CF8000A6807000034102207002953CDA10A02070B040E9D0A09@comcast.net>


Hi,
Is there a limitation whereby I can't substitute the variable (varname) with literal string such such name or sal in the ORDER BY clause below? I can use variable in the WHERE clause but not in the ORDER BY.

OPEN emprefcursor FOR
select name from emp where sal>10000 order by varname;

Based on certain conditions, the varname can be name or sal. However, for some reasons, when I ran the procedure, it failed to replace the varname. Any other alternatives to accomplish the same thing?

Thanks.

Geraldine

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Mar 22 2005 - 15:19:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US