- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to capitalize a string in ORACLE?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 01:47 AM
тАО11-07-2005 01:47 AM
a maybe stupid question:
I've the user name in lower case, but it's stored inside the database in upper case; how can I capitalize it in order to use inside a query?
I can do it outside ORACLE or inside (i.e. in sqlplus).
What's the best way?
thanks a lot
Enrico
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 02:02 AM
тАО11-07-2005 02:02 AM
Re: How to capitalize a string in ORACLE?
If you have the usernames in a file
cat filename | awk '{print toupper($0)}'
should do the job or better you can use them in the query like
...WHERE user = UPPER('&user')...
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 07:24 AM
тАО11-07-2005 07:24 AM
Re: How to capitalize a string in ORACLE?
How about using the string function upper() within SQL*Plus for ex:
SQL> select * from
/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 11:40 AM
тАО11-07-2005 11:40 AM
Re: How to capitalize a string in ORACLE?
You can use the UPPER and LOWER functions of oracle when you want to user upper-case or lower-case characters in your query.
For eg:
SQL> select upper('ent') from dual;
UPP
---
ENT
SQL> select lower('AAA') from dual;
LOW
---
aaa
To select and compare with upper-case name
then
SQL>select col1, col2......
from tab1
where col2 = upper('string');
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 03:42 PM
тАО11-07-2005 03:42 PM
Re: How to capitalize a string in ORACLE?
better do it in the database in case your number of records is not much and performance is not an issue.
e.g.
select *
from dba_users
where lower(username)='&username';
or
select *
from dba_users
where username= upper('&username');
there is also soundex function which you use in other cases:
select * from t where soundex_column = soundex( 'some word' )
hope this helps too!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-07-2005 08:59 PM
тАО11-07-2005 08:59 PM
Re: How to capitalize a string in ORACLE?
you could use the function upper() to capitalize string you are searching in SQL.
Take care that if teh field you are searcing are indexed this may casue a delay in the query.
My suggestion is to capitalize it outside SQL using:
typeset -u User_In_Uppercase=
HTH,
Art