Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!easynews.com!easynews!cyclone1.gnilink.net!ngpeer.news.aol.com!newsfeed1!bredband!uio.no!feed.news.nacamar.de!newsfeed.ision.net!news.is-europe.net!ision!not-for-mail
From: "Guido Konsolke" <Guido.Konsolke@triaton.com>
Newsgroups: comp.databases.oracle.misc
Subject: Re: Help please with Oracle
Date: Mon, 5 May 2003 13:29:45 +0200
Organization: Ye 'Ol Disorganized NNTPCache groupie
Lines: 32
Message-ID: <1052133780.672728@news.thyssen.com>
References: <GSqta.92421$DT4.2849333@twister1.libero.it>
NNTP-Posting-Host: 149.211.49.31
X-Trace: goliath.news.is-europe.net 1052134187 27674 149.211.49.31 (5 May 2003 11:29:47 GMT)
X-Complaints-To: abuse@is-europe.net
NNTP-Posting-Date: 5 May 2003 11:29:47 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Cache-Post-Path: news.thyssen.com!unknown@170.56.164.197
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
Xref: core-easynews comp.databases.oracle.misc:97308
X-Received-Date: Mon, 05 May 2003 04:29:16 MST (news.easynews.com)

"Limner" wrote...
>
> Hi to all
>
> i've a question.
> I need to know how to count how many times it present a particular
caracter
> in a varchar2 field ( i've oracle 9i )
>
> For example:     " Pippo|pluto|paperino"  and i want to know how many
times
> is present the caracter "|"    ( 2 times )
>
> can someone help me in this ??
>
> Thanks in advance
>
> Danilo
>
Hi Danilo,

until someone offers a better solution, here's an ugly one:
you have to eliminate all characters that are not '|'. This can be done
by using the REPLCAE function. You will need to provide *every* character
that *might* occur. Step 2 is to wrap this monster with the LENGTH()
function.

hth and someone does better,

Guido


