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: return first token/word from string?

Re: return first token/word from string?

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 22 Aug 2007 13:29:40 -0700
Message-ID: <1187814578.143830@bubbleator.drizzle.com>


Brian Peasland wrote:
> jobs wrote:

>> On Aug 22, 3:31 pm, DA Morgan <damor..._at_psoug.org> wrote:
>>> jobs wrote:
>>>> I'm on Oracle 9i. Is there any built in function that would return the
>>>> first token or string from a string?
>>>> For example, given string  = "     bob    lfcr   bill"
>>>> I want to return "bob"
>>>> imediately following bob there might be cases where we have a linefeed/
>>>> cr.
>>>> Thanks for any help or information.
>>> Look at REGEXP_SUBSTRhttp://www.psoug.org/reference/regexp.html#rerp
>>> -- 
>>> Daniel A. Morgan
>>> University of Washington
>>> damor..._at_x.washington.edu (replace x with u to respond)
>>> Puget Sound Oracle Users Groupwww.psoug.org
>>
>> Is that supported in 9i? I can't seem to get it to work here.
>>

>
> It is not supported in 9i. Regular Expression functions first appear in
> 10g.
>
> Most likely in 9i, you'll have to build your own functions using the
> INSTR and SUBSTR functions.
>
> HTH,
> Brian

It has been so long since I've seen 9i I forgot about that.

Well there is always the OWA_PATTERN built-in package but it runs at a speed that is glacial compared with REGEXP. Still it is an option.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed Aug 22 2007 - 15:29:40 CDT

Original text of this message

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