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: String function

Re: String function

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 26 Aug 2003 13:07:51 +0200
Message-ID: <vkmhi6a0qhr1a@corp.supernews.com>

"Max" <massimo.panero_at_ideainformatica.org> wrote in message news:bifarn$8hvkb$1_at_ID-121437.news.uni-berlin.de...
> Is there a function that return how many occurrence of a substring are in
a
> string?
> Or how can i do by myself?
> Example:
> ST := 'THIS IS A STRING';
> N := XFunction ( ST, 'S' ); // return 3
> N := XFunction ( ST, 'IS' ); // return 2
> N := XFunction ( ST, 'X' ); // return 0
>
>

just write a function with a while loop calling the native instr function. When the search string isn't found anymore instr returns 0

-- 
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Tue Aug 26 2003 - 06:07:51 CDT

Original text of this message

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