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: regexp_substr occurrences problem

Re: regexp_substr occurrences problem

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 18 Sep 2006 08:52:48 -0700
Message-ID: <1158594768.168225@bubbleator.drizzle.com>


PhilHibbs wrote:
> Why doesn't this match more than once:
>
> DECLARE
> i NUMBER := 1;
> s VARCHAR2(10);
> BEGIN
> LOOP
> s := REGEXP_SUBSTR( 'ABC|DEF|GHI|JLK', '\|[^\|]+\|', 1, i )
> EXIT WHEN s IS NULL;
> i := i + 1;
> DBMS_OUTPUT.PUT_LINE( s );
> END LOOP;
> END;
>
> All I get is |DEF| when I think I should get |GHI| as well. Where am I
> going wrong?
>
> Phil Hibbs.

 From what input data?

I'm still trying to figure out why you wrote an infinite loop?

-- 
Daniel Morgan
University of Washington
Puget Sound Oracle Users Group
Received on Mon Sep 18 2006 - 10:52:48 CDT

Original text of this message

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