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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Looking for a SQL Function

Re: Looking for a SQL Function

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Wed, 02 Nov 2005 10:07:38 +0100
Message-ID: <4368820f$0$21954$9b4e6d93@newsread2.arcor-online.net>


R. P. schrieb:
> Is there an Oracle character function returning the number of occurances
> of a substring in a string? INSTR() is close but not quite what I am
> looking for.
>
> Thanks,
> Rudy

SQL> var line varchar2(100);
SQL> exec :line:='abcde abc abc abs abcde';

PL/SQL procedure successfully completed.

SQL> var matches number;
SQL> exec :matches:=owa_pattern.change(:line,'abc','abc','g');

PL/SQL procedure successfully completed.

SQL> print matches

    MATCHES


          4

SQL> Best regards

Maxim Received on Wed Nov 02 2005 - 03:07:38 CST

Original text of this message

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