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: Split/cut a string

Re: Split/cut a string

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 19 Sep 2006 13:45:20 -0700
Message-ID: <1158698718.77486@bubbleator.drizzle.com>


jpabich wrote:
> I have a stored procedure where I want to get the last characters off a
> string. Say I have
>
> i VARCHAR2;
>
> i := 'ABC12345';
>
> I want to be able to get the 12345 off. How do I do this?

Your demo doesn't match you words.

Your words say "last characters" which would be "5".

What is it you really want?
If it is the numbers then I would suggest using TRANSLATE.

SELECT TRANSLATE('ABC12345', '1ABC', '1') FROM dual;

Will be very efficient.

-- 
Daniel Morgan
University of Washington
Puget Sound Oracle Users Group
Received on Tue Sep 19 2006 - 15:45:20 CDT

Original text of this message

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