Yeah _faq, pay attention to example above. What's up with that?
DaPi used initcap for specific purpose.
:rolleyes:
Printable View
Yeah _faq, pay attention to example above. What's up with that?
DaPi used initcap for specific purpose.
:rolleyes:
Sorry wrong thought process took me somewhere else only.
you are something..!!!Quote:
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 . . .
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 shivagami,Quote:
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.
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
Thanks DAPI. It's Excellent.Quote:
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;
Kishan
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