If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Propercase or Title Case Function?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Propercase or Title Case Function?

Hello all,
My name is Donald and I'm new to the DB2 forum. I'm trying to figure out if there is a command (or way) to change all the uppercase text strings to proper?


Any help would be great!!

-Donald
Reply With Quote
  #2 (permalink)  
Old
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 5,396
As far as I know, there are no built-in functions like that, you'll need to roll your own.
__________________
---
"It does not work" is not a valid problem statement.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2009
Posts: 505
Donald, in DB2 LUW V9.7, the INITCAP function might be what you are looking for:

SELECT INITCAP('AAA bb CCC dddd EEE')
FROM SYSIBM.SYSDUMMY1

1
-------------------
Aaa Bb Ccc Dddd Eee

1 record(s) selected.
[/CODE]
(I am not sure exactly what you mean by 'proper'.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Quote:
Originally Posted by Stealth_DBA View Post
Donald, in DB2 LUW V9.7, the INITCAP function might be what you are looking for:

SELECT INITCAP('AAA bb CCC dddd EEE')
FROM SYSIBM.SYSDUMMY1

1
-------------------
Aaa Bb Ccc Dddd Eee

1 record(s) selected.
[/CODE]
(I am not sure exactly what you mean by 'proper'.
Thank you for the recommendation. Maybe I should provide more information. I'm an enduser of DB2 Version 8 and when I query data, my description column contains text strings that are all in uppercase ex. (JOHN SMITH), I'm trying find out a way if there is a command like that would act like the "proper" function in MS Excel so the outcome would be "John Smith". I'm familar with the "lcase" function and also the "ucase" function.

I tried to incorporate the "INITCAP" function, and looked it up on the net, apparently there's no DB2 equivalent, but best suited for Oracle SQL.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: May 2009
Posts: 505
There is no DB2 equivalent in DB2 LUW V8. There is in DB2 LUW V9.7 (which doesn't do you any good in V8, however). But even INITCAP would have a problem with 'double' capitals in a name (i.e. James MacDougall). PS probably not your call but I would upgrade from V8 as soon as possible. It went out of support quite awhile ago.
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Quote:
Originally Posted by Stealth_DBA View Post
There is no DB2 equivalent in DB2 LUW V8. There is in DB2 LUW V9.7 (which doesn't do you any good in V8, however). But even INITCAP would have a problem with 'double' capitals in a name (i.e. James MacDougall). PS probably not your call but I would upgrade from V8 as soon as possible. It went out of support quite awhile ago.
Thanks for the additional insight Stealth DBA. Unfortunately, I don't forsee the company I work for upgrading in the near future.

-Donald
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,734
Quote:
Originally Posted by Donald L View Post
Thanks for the additional insight Stealth DBA. Unfortunately, I don't forsee the company I work for upgrading in the near future.

-Donald
Are you using DB2 for Linux, UNIX, Windows, or DB2 for z/OS (mainframe).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Quote:
Originally Posted by Marcus_A View Post
Are you using DB2 for Linux, UNIX, Windows, or DB2 for z/OS (mainframe).
I'm using DB2 for Windows.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On