Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> ORDER BY question
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