aspose file tools
The moose likes JDBC and the fly likes How do lower/upper work in SQL? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "How do lower/upper work in SQL?" Watch "How do lower/upper work in SQL?" New topic
Author

How do lower/upper work in SQL?

Mallika Kumar
Ranch Hand

Joined: Feb 15, 2001
Posts: 61
Hi,
I'm trying to execute the following select statement in Oracle 8i.
SELECT EMPNO,LOWER(EMPNAME) FROM EMPLOYEE WHERE EMPNAME LIKE ?
What actually happens here ? My understanding was that EMPNAME column values are first lower-cased, and then SELECT statement is executed.
If I have EMPNAME column value as 'Mallika', and I pass 'mallika' to the above query, I expected the column value to be 'mallika' in the database temporarily. But I'm not getting the row containing 'Mallika'. If I pass 'Mallika', I get the row. So, is the execution of the query in the following order ?
1. First query is executed and rows are obtained.
2. Next, EMPNAME column values are converted into lowercase and then shown.
Have I interpreted in correctly ? Any clarifications will be helpful.
Thanks.
Daniel Dunleavy
Ranch Hand

Joined: Mar 13, 2001
Posts: 276
you almost had it. You set the return values to lower.
If you want to do it during the compare, you use the lower in the where clause
ex : select empname, empno from emp where lower(empname) like 'mi%'
Dan
[This message has been edited by Daniel Dunleavy (edited June 05, 2001).]
Mallika Kumar
Ranch Hand

Joined: Feb 15, 2001
Posts: 61
Thanks a lot Daniel.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do lower/upper work in SQL?
 
Similar Threads
Java Script Drop-down option deletion but little bit different
Navigating data using JDBC and SQLServer 2005
TableGenerator
Ignoring case in queries.........
SQL Question