Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL substr(instr oracle

Re: PL/SQL substr(instr oracle

From: Noons <wizofoz2k_at_yahoo.com.au.nospam>
Date: Sat, 21 Jun 2003 09:56:31 +1000
Message-ID: <3ef39ff8$0$24424$afc38c87@news.optusnet.com.au>


"Rauf Sarwar" <rs_arwar_at_hotmail.com> wrote in message news:92eeeff0.0306200736.f5ae063_at_posting.google.com...
>
> Unless my brain is gone on vacation... this is not going to work. Try
> it for yourself. I believe this is the query you are referring to, I
> just added ) after -1 to make it run,
>
> select substr('&STR',1,instr('&STR','_')-1)||
> translate(initcap(replace(substr('&STR',instr
> ('&STR','_')),'_',' ')),' abcdefghijklmnopqrstuvwxyz','_')
> from dual;
>
> YC_C_I_M_C

Ooops. You're right. I was trying to do something else and added the "_" between each subsequent word. It was needed for another string transformation I was playing with.

Just expanded the whole thread and realized the OP was asking for no underscores between the first letters of each word. That should make it a lot easier. I'll look into this Monday back at the office. Don't have access to Oracle until then, my notebook's battery is on the blink.

I can't believe no one else has found another way of doing this. Come on folks! Give it a go. It's fun to "push" SQL like this. Makes a change from "Java frameworks"!

--
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Fri Jun 20 2003 - 18:56:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US