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

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

RE: using variable name in order by

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Tue, 22 Mar 2005 15:22:51 -0500
Message-ID: <004501c52f1c$ebd0da10$2004a8c0@development.perceptron.com>


Using dynamic sql.

Igor Neyman, OCP DBA
ineyman_at_perceptron.com

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of geraldine_2_at_comcast.net
Sent: Tuesday, March 22, 2005 3:16 PM
To: oracle-l_at_freelists.org
Subject: using variable name in order by

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

--

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

Original text of this message

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