Home » SQL & PL/SQL » SQL & PL/SQL » How to Find out the lowercase char in a String
How to Find out the lowercase char in a String [message #320743] Fri, 16 May 2008 03:09 Go to next message
kathiresan.c
Messages: 23
Registered: February 2008
Location: Tamil Nadu, India
Junior Member
Hi Friends,

How to find out lowercase char in a String in a SQL query
for example
"ORAclE" here c and l are lowercase so how can i find out this condition... is there any build in function in oracle?

or You have a solution for this.. please reply me


thanks in advance
Re: How to Find out the lowercase char in a String [message #320747 is a reply to message #320743] Fri, 16 May 2008 03:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do you want to know:
- if there are lower case characters?
- what are the lower case characters?
- how many lower case characters?
- how many for each lower case character?
- where (at which indices) are the lower case characters?
...

Regards
Michel
Re: How to Find out the lowercase char in a String [message #320751 is a reply to message #320743] Fri, 16 May 2008 03:24 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
hope michel drilled your brain
Re: How to Find out the lowercase char in a String [message #320754 is a reply to message #320747] Fri, 16 May 2008 03:27 Go to previous messageGo to next message
kathiresan.c
Messages: 23
Registered: February 2008
Location: Tamil Nadu, India
Junior Member
HI Michel
i want to find out the last char is lower or upper
if it is lower then i want to some operation

Re: How to Find out the lowercase char in a String [message #320758 is a reply to message #320754] Fri, 16 May 2008 03:28 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
just use SUBSTR to get the last character, and then check if last_character = UPPER(last_character).
If it does, then it was upper case.
Re: How to Find out the lowercase char in a String [message #320761 is a reply to message #320754] Fri, 16 May 2008 03:34 Go to previous messageGo to next message
kathiresan.c
Messages: 23
Registered: February 2008
Location: Tamil Nadu, India
Junior Member
thank u Michel
Re: How to Find out the lowercase char in a String [message #320762 is a reply to message #320758] Fri, 16 May 2008 03:34 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
i think, it should be with length function
Re: How to Find out the lowercase char in a String [message #320766 is a reply to message #320762] Fri, 16 May 2008 03:36 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Do enlighten me. How do you use the length function to determine the case of the last character of a string - other than by using some other function to actually modify the data, and using length to check the result of that?
Re: How to Find out the lowercase char in a String [message #320768 is a reply to message #320766] Fri, 16 May 2008 03:39 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
when you are suggesting substr, how will you decide the last char position without using len..

i have not disturbed remaining part of your suggestion..
correct me... if i am wrong...

thanks
Re: How to Find out the lowercase char in a String [message #320769 is a reply to message #320754] Fri, 16 May 2008 03:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
substr gives you the last character, comparing it with its lower value will give you if it is upper or lower case.

Regards
Michel
Re: How to Find out the lowercase char in a String [message #320848 is a reply to message #320768] Fri, 16 May 2008 07:52 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
By specifying a -ve value for the second parameter:
SQL> select substr('abcdefgh',-1) from dual;

S
-
h
Re: How to Find out the lowercase char in a String [message #519429 is a reply to message #320848] Fri, 12 August 2011 02:06 Go to previous messageGo to next message
manuram
Messages: 1
Registered: August 2011
Junior Member
--If the string is saved in a column (say 'col1' in table 'tab1' then you can use:
select col1 from tab1 where regexp_like(col1, '[a-z]');
Re: How to Find out the lowercase char in a String [message #519469 is a reply to message #519429] Fri, 12 August 2011 07:56 Go to previous messageGo to next message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
It's great that you learned how to use regular expressions, but this has nothing to do with question, and 3 years later no less.
Re: How to Find out the lowercase char in a String [message #519476 is a reply to message #519469] Fri, 12 August 2011 10:20 Go to previous message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
Ahhh, I don't get to post much here nowadays (you geniuses..es ..es all post too quick for me Wink ) but I do enjoy a good bit of thread necromancy Very Happy
Previous Topic: SELECT with count of rows depending on sum of a field
Next Topic: Oracle Locking issues
Goto Forum:
  


Current Time: Sat Dec 10 14:38:07 CST 2016

Total time taken to generate the page: 0.10265 seconds