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: Nuno Souto <wizofoz2k_at_yahoo.com.au>
Date: 19 Jun 2003 15:48:53 -0700
Message-ID: <73e20c6c.0306191448.217976db@posting.google.com>


rs_arwar_at_hotmail.com (Rauf Sarwar) wrote in message news:<92eeeff0.0306181306.1bf89859_at_posting.google.com>...
>
> I am sure this can be done easily in PL/SQL but it's fun doing it in
> SQL -:)
<sorry, i love this kind of string processing!>

this is better than my previous attempt:

select substr('&STR',1,instr('&STR','_')-1|| translate(initcap(replace(substr('&STR',instr ('&STR','_')),'_',' ')),'abcdefghijklmnopqrstuvwxyz','_') from dual;

I'd love to see the DB2 and SQL Server boffins tells us how they do this. :D

Can anyone improve on it as is? It's darn efficient too: much less replaces/lengths/substr than before.

Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam Received on Thu Jun 19 2003 - 17:48:53 CDT

Original text of this message

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