IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To find LCASE values in columns and update to UCASE


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Thu Apr 17, 2008 3:32 pm
Reply with quote

Hi ,

I need a DB2 query or suggestions to find lower case values(can be part of a string/whole string) in selected columns of a table and update them to upper case once lower case values are fetched.

For Example:

Table A:

Col1 Col2 Col3
----- ----- -----
1 ABC xyz
2 Abc Xyz
3 ABC XYZ
4 abc xyz

The output result I need in fetch:

Col1 Col2 Col3
----- ----- -----
1 ABC xyz
2 Abc Xyz
4 abc xyz

Your help will be appreciated.

Thanks,
Krishna.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Apr 17, 2008 3:38 pm
Reply with quote

what about?

Code:
update YOURTABLEHERE
   set column = ucase(column)                       
 where column ¬=ucase(column)   
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Apr 17, 2008 3:40 pm
Reply with quote

I thought your requirement was: Change to Uppercase those columns with Lowercase values... but now that I read your example... I'm not sure is that what you need.
Back to top
View user's profile Send private message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Thu Apr 17, 2008 3:46 pm
Reply with quote

Thanks for the reply..but my requirement is not that short.

At first I need to find the values in columns which are in lower case..then I need to update them by primary key.

So please provide me a DB2 query to find lower case values and to avoid confusion I am not looking for conversions as what you mentioned to update UCASE(:var1).

-Krishna.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Apr 17, 2008 4:17 pm
Reply with quote

So please provide me a DB2 query to find lower case values

Code:
where column ¬=ucase(column)   


will give you all those rows with lower case values in COLUMN... if this is not what you need...you'll have to wait for a DB2 Expert o try yourself.

hth.
Back to top
View user's profile Send private message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 37
Location: Chennai

PostPosted: Thu Apr 17, 2008 5:05 pm
Reply with quote

Thanks a lot!!!

Its working.

-Krishna.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top