Is there any way to ORDER BY case-insensitively if you don't know the column type?

I have a method in a webapp which displays tables with clickable column headings which sort by the clicked-on column. I give it a table/view name and a list of column names, and it does the rest. The method is completely general and knows nothing about what it is displaying.

My problem is that I want to sort case insensitively. I can of course modify the method to generate ORDER BY UPPER(x) instead of ORDER BY x, which will work for text columns, but for numberical columns I will end up sorting textually: values 1,2,10 will be sorted as 1,10,2.

Any ideas?
John English

This email has been checked for viruses by AVG.

Reply via email to