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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm


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