From oracle-l-bounce@freelists.org Tue Mar 22 15:26:27 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id j2MLQQ6B009777 for ; Tue, 22 Mar 2005 15:26:26 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j2MLQQem009771 for ; Tue, 22 Mar 2005 15:26:26 -0600 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3D1718810F; Tue, 22 Mar 2005 15:24:39 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03933-05; Tue, 22 Mar 2005 15:24:39 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B206288159; Tue, 22 Mar 2005 15:24:38 -0500 (EST) From: "Igor Neyman" To: , Subject: RE: using variable name in order by Date: Tue, 22 Mar 2005 15:22:51 -0500 Message-ID: <004501c52f1c$ebd0da10$2004a8c0@development.perceptron.com> MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit In-Reply-To: <032220052015.13328.42407CF8000A6807000034102207002953CDA10A02070B040E9D0A09@comcast.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-archive-position: 17615 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: ineyman@perceptron.com Precedence: normal Reply-To: ineyman@perceptron.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on air891.startdedicated.com X-Spam-Status: No, hits=0.1 required=5.0 tests=AWL autolearn=ham version=2.60 X-Spam-Level: Using dynamic sql. Igor Neyman, OCP DBA ineyman@perceptron.com -----Original Message----- From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org] On Behalf Of geraldine_2@comcast.net Sent: Tuesday, March 22, 2005 3:16 PM To: oracle-l@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