Re: substr instr

  • From: "Rich Jesse" <rjoralist@xxxxxxxxxxxxxxxxxxxxx>
  • To: barb.baker@xxxxxxxxx
  • Date: Tue, 28 Jul 2009 13:44:58 -0500 (CDT)

Hey Barb,

Almost -- just needed to shorten up the length of the SUBSTR.  Try testing
with this:

select
SUBSTR(:stringy, INSTR(:stringy, ':', 1, 1)+1,
LENGTH(:stringy)-INSTR(:stringy, ',', 1,1))
from dual;

Note the comma location being subtracted from the LENGTH of the string.

TEST FIRST PLEASE!

HTH!  GL!

Rich

> I've gotten as far as getting anything past the :  then I get stuck:
>
> select
> SUBSTR('Start net counter : 26798, 24794',
>  INSTR('Start net counter : 26798, 24794', ':', 1, 1)+1,
>  INSTR('Start net counter : 26798, 24794', ',', 1,1)-1)
> from dual;
>
> SUBSTR('START
> -------------
>  26798, 24794
>
> I'd be grateful for any help.  Data is currently in a 9.2.0.7 oracle
> database on linux.
>
> Thanks!
> Barb Baker


--
//www.freelists.org/webpage/oracle-l


Other related posts: