473,624 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query to fetch name with mixed case

4 New Member
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 8805
debasisdas
8,127 Recognized Expert Expert
Can you post the query that you are working on.
Nov 6 '08 #2
suvitha
4 New Member
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
suvitha
4 New Member
select * from tablename where regexp_like(nam e,'[A-Z]'); - I executed this query and got

ERROR at line 1:ORA-00920: invalid relational operator
Nov 6 '08 #4
suvitha
4 New Member
[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 Recognized Expert Top Contributor
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 New Member
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 Recognized Expert Top Contributor
Its always better not to use != (inequality) sign with strings

My solution that includes TRANSLATE,REPLA CE 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 New Member
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 Recognized Expert Top Contributor
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

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

Similar topics

10
8349
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 is a test or This Is A Test. Is there any easy way to do this. Thanks
46
2705
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 names the same as that for variable names. Looking at the examples below, which ones seem better? Straight names echoclient lastcharoffset helloworld Internal underscores
7
3525
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 the point. I have this Python program, that performs MySQL queries to a database. These queries are performed at regular intervals. Basically it is looking for fields that match certain criterias. Such fields are not present at all time. When the program finds such field, it then takes
7
3189
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 str_replace() to strip out such content, but then one ends up looking for characters that wrap around the stripped characters and it ends up as a recursive ordeal that fails to identify a poorly constructed $_GET variable (when someone hand-types the item into the line and makes a simple typing error).
4
10279
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 for tables and columns. Although my CREATE TABLE commands issued via jdbc uses mixed case for the names, db2 insists on using only upper case. (This also happens from the CLP or DB2CC, but my concern is for it to work via jdbc.) Is there a simple setting at the database level to allow mixed...
8
6387
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 changing JOE SMITH to Joe Smith. What to I have to do to have the user change the name, but keep the key? Overall, I think any "edits" simply add a new record, rather than change the existing record. The form is simple - Choose the vendor from the drop-down list. After Update, a new field...
9
1884
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... is it also customary to write them in mixed case, asWithThisName? Or is it a horrible horrible horrible thing to do??
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.