View previous topic :: View next topic
|
Author |
Message |
Krishnadeva Reddy
New User
Joined: 14 Nov 2007 Posts: 37 Location: Chennai
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
what about?
Code: |
update YOURTABLEHERE
set column = ucase(column)
where column ¬=ucase(column) |
|
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
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 |
|
|
Krishnadeva Reddy
New User
Joined: 14 Nov 2007 Posts: 37 Location: Chennai
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
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 |
|
|
Krishnadeva Reddy
New User
Joined: 14 Nov 2007 Posts: 37 Location: Chennai
|
|
|
|
Thanks a lot!!!
Its working.
-Krishna. |
|
Back to top |
|
|
|