Re: how do i split a string
Date: Tue, 14 Oct 2008 09:09:51 -0700 (PDT)
Message-ID: <5c6a55cc-f094-4937-bc47-00e92d8cfa72@u27g2000pro.googlegroups.com>
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 -- Received on Tue Oct 14 2008 - 11:09:51 CDT