-
Yeah _faq, pay attention to example above. What's up with that?
DaPi used initcap for specific purpose.
-
Sorry wrong thought process took me somewhere else only.
-
Originally posted by DaPi
translate(initcap(column),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')
Will deal with any number of names - but I feel there must be a neater way . . .
you are something..!!!
PHP Code:
create table test_to_del
(
name varchar2(20)
);
insert into test_to_del values ('saM len');
insert into test_to_del values ('a b');
insert into test_to_del values ('q v');
select replace(translate(initcap(name),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),' ','')
from test_to_del;
REPLACE(TRANSLATE(IN
--------------------
SL
AB
QV
drop table test_to_del;
-
Originally posted by rshivagami
select substr(names,1,1) || substr(names, instr(names,' ')+1,1) from tablename;
You might want to add a decode before the second concatenation to check if there is a space.
Thanks shivagami,
but I am not able to get the correct output.can you pls show me how it works by using the decode.
For instance samantha Mary - it should display the initial as SM
but as per the above query it is displaying only S
Thanks a lot
Kishan
SUROOP B
-
Originally posted by aspdba
you are something..!!!
PHP Code:
create table test_to_del
(
name varchar2(20)
);
insert into test_to_del values ('saM len');
insert into test_to_del values ('a b');
insert into test_to_del values ('q v');
select replace(translate(initcap(name),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),' ','')
from test_to_del;
REPLACE(TRANSLATE(IN
--------------------
SL
AB
QV
drop table test_to_del;
Thanks DAPI. It's Excellent.
Kishan
SUROOP B
-
Kishan, are you saying mine and shivagami's code did not work? (they are identical)
Are you sure you were not running some other code?
d
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|