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 find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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