Re: substr instr
From: Rich Jesse <rjoralist_at_society.servebeer.com>
Date: Tue, 28 Jul 2009 14:35:40 -0500 (CDT)
Message-ID: <1fd09e7919e20a0dc8386d71d4dad941.squirrel_at_society.servebeer.com>
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:
Date: Tue, 28 Jul 2009 14:35:40 -0500 (CDT)
Message-ID: <1fd09e7919e20a0dc8386d71d4dad941.squirrel_at_society.servebeer.com>
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!
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Jul 28 2009 - 14:35:40 CDT