472,352 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 software developers and data experts.

Query to fetch name with mixed case

Hi All,

Can anyone of you send me a query to fetch only the name of the users who has name in mixed case (lower and upper case) .

And query to fetch only name with upper case ?

Thanks.
Nov 6 '08 #1
11 8601
debasisdas
8,127 Expert 4TB
Can you post the query that you are working on.
Nov 6 '08 #2
Can you post the query that you are working on.

Hi,

I hv not tried that one .....as i am not familiar with that .

Can u help.
Nov 6 '08 #3
select * from tablename where regexp_like(name,'[A-Z]'); - I executed this query and got

ERROR at line 1:ORA-00920: invalid relational operator
Nov 6 '08 #4
[IMG]Hello[/IMG]

Found the query:

select name from tablename where name != lower(name);


Hope this will help others
Nov 6 '08 #5
amitpatel66
2,367 Expert 2GB
For Mixed Case and Upper Case fetch

Expand|Select|Wrap|Line Numbers
  1.  
  2. select * from emp where 
  3. LENGTH(REPLACE(TRANSLATE(name,'abcdefghijklmnopqrstuvwxyz',' '),' ','')) > 0
  4.  
  5.  
Nov 10 '08 #6
Pilgrim333
127 100+
For Mixed Case and Upper Case fetch

Expand|Select|Wrap|Line Numbers
  1.  
  2. select * from emp where 
  3. LENGTH(REPLACE(TRANSLATE(name,'abcdefghijklmnopqrstuvwxyz',' '),' ','')) > 0
  4.  
  5.  
wouldn't it be easier to use

Expand|Select|Wrap|Line Numbers
  1. select * from emp
  2. where name != lower(name) --Only this line in case of mixed cases and upper cases
  3. and   name != upper(name) --add this line just to get mixed cases
  4.  
Nov 10 '08 #7
amitpatel66
2,367 Expert 2GB
Its always better not to use != (inequality) sign with strings

My solution that includes TRANSLATE,REPLACE can be easily rewritten using Regular Expressions in 10g. I am using 9i in my office so provided that solution
Nov 11 '08 #8
Pilgrim333
127 100+
Well, in this case, the inequality is the lesser evil. The translate and replace will have to go through each string from the start to the end, even if there are no occurances of the occurance to replace or translate. Using a combination of translate and replace will make the query a lot slower. The inequality will stop with the comparison as soon as it finds the first difference.

Pilgrim.
Nov 11 '08 #9
amitpatel66
2,367 Expert 2GB
Its not becuase of performance that I am asking not to use inequality, its because it causes wrong results some times in real time scenarios
Nov 11 '08 #10
Pilgrim333
127 100+
Ah ok, in some cases it can lead to wrong results indeed.

Pilgrim.
Nov 11 '08 #11
Saii
145 Expert 100+
Which Oracle version are you using? In 10g you can use regular expressions
Nov 14 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Wonderinguy | last post by:
I have a table with data stored on upper case. I would like to change it proper mixed case. For example : change data from , THIS IS A TEST to This...
46
by: James Harris | last post by:
Before I embark on a new long-term project I'd appreciate your advice on how to split up long names. I would like to keep the standards for command...
7
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to...
7
by: Jim Carlock | last post by:
Looking for suggestions on how to handle bad words that might get passed in through $_GET variables. My first thoughts included using...
4
by: natG | last post by:
Hi; I am transferring data from MySql to db2 using my own java/jdbc program. Working out ok, except for the fact that our apps use mixed-case names...
8
by: sara | last post by:
I have a table where a few of the users entered vendor names ALL IN UPPER CASE. I have created forms to edit the data, but I can't seem to allow...
9
by: s0suk3 | last post by:
I'm totally new to C, so this is a question from a total newbie. I know most people write the names in C with underscores, as_in_this_name. But......
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.