Re: how do i split a string
Date: Tue, 14 Oct 2008 13:16:18 -0700 (PDT)
Message-ID: <6c01f076-3f79-475e-a1d5-910d5599f373@v39g2000pro.googlegroups.com>
On Oct 14, 9:09 am, Mark D Powell <Mark.Pow..._at_eds.com> wrote:
> On Oct 13, 9:43 pm, "Bob Jones" <em..._at_me.not> wrote:
>
>
>
> > <emdproduct..._at_hotmail.com> wrote in message
>
> >news:8a7a71fc-e783-4e0a-8a00-ae8d984c8024_at_d31g2000hsg.googlegroups.com...
>
> > > group,
>
> > > I have a record like this
> > > 12**5***
>
> > > I need to know the 1st occurance of *, and length of it
> > > the 2nd occurance of * and the length of it
>
> > > for example, for 12**5***, I need to get 3263
> > > meaning the 1st one start at 3, length is 2, the 2nd one start at 6,
> > > the length is 2
>
> > > Your help is highly appreciated
>
> > select regexp_instr('12**5***','\*+',1,1)
> > ||length(regexp_substr('12**5***','\*+',1,1))
> > ||regexp_instr('12**5***','\*+',1,2)
> > ||length(regexp_substr('12**5***','\*+',1,2))
> > from dual
>
> Emdproduct, Bob's answers requires that you have Oracle version 10g+.
> If you have an earlier version of Oracle a different solution will
> have to be sought.
>
> HTH -- Mark D Powell --
You could probably still find the owa_pattern package for use on older releases.
While slower and not quite as easy to use, it still works. Received on Tue Oct 14 2008 - 15:16:18 CDT