Re: substr instr

  • From: "Rich Jesse" <rjoralist@xxxxxxxxxxxxxxxxxxxxx>
  • To: rjoralist@xxxxxxxxxxxxxxxxxxxxx
  • Date: Tue, 28 Jul 2009 14:35:40 -0500 (CDT)

Rats!  I didn't test w/strings on either side of the comma having unequal
length.  In addition to all the other answers here, this:

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

...should work.

Rich

> 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!



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


Other related posts: