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

Home -> Community -> Usenet -> c.d.o.misc -> ORDER BY question

ORDER BY question

From: David A. Gershman <dgers_at_pizza>
Date: 1997/10/15
Message-ID: <623hpt$42a@hacgate2.hac.com>#1/1

In a procedure with the select statement:

  select Last_name, First_Name from Emp_Table Where (Last_Name) like 'GER%'   order by 2, 1;

I'd like the ORDER BY values to be provided by an HTML form user. Hence the 2 and 1 would be in VarChar2 variables.

Question: Is there a way to 'convert' the VarChar2 variables into a data type that can be used by the ORDER BY? I've tried To_Number() and it doesn't work, nor does putting VarChar2 variables containing the column names in place of 2 and 1.

i.e. the following don't work...

  select ..... Order by Search1, Search2;

nor does

  select ..... Order by To_Number( Search1 ), To_Number( Search2 );

Any and all help would be *greatly* appreciated! Thanks in advance.

--

"Artificial Intelligence:  Making computers behave like they do in the movies."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David A. Gershman : SSE Lab Administrator, MTS Comp Sci/Math
Hughes Information Technology Systems, Fullerton California
(714) 446-2669  -  dgers_at_sed.hac.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Wed Oct 15 1997 - 00:00:00 CDT

Original text of this message

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