Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To find LCASE values in columns and update to UCASE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Krishnadeva Reddy

New User


Joined: 14 Nov 2007
Posts: 36
Location: Chennai

PostPosted: Thu Apr 17, 2008 3:32 pm    Post subject: To find LCASE values in columns and update to UCASE
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    Post subject:
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    Post subject:
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: 36
Location: Chennai

PostPosted: Thu Apr 17, 2008 3:46 pm    Post subject: Reply to: To find LCASE values in columns and update to UCAS
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    Post subject:
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: 36
Location: Chennai

PostPosted: Thu Apr 17, 2008 5:05 pm    Post subject: Reply to: To find LCASE values in columns and update to UCAS
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us