1
PSOUG / Re: REGEXP_SUBSTR Function usage
« on: August 10, 2011, 04:26:38 pm »
Sorry about that last post, it's a little ugly. I didn't expect it to expose all of the RTF code.
Here it is again:
Check this out:
SELECT REGEXP_SUBSTR( '001.069012...3301', '([^.]*)(.|$)', 1, 5, NULL, 1 ) RESULT
FROM DUAL
;
This only works on 11g.
If you are on 10g, use this:
SELECT RTRIM( REGEXP_SUBSTR( '001.069012...3301', '[^.]*(.|$)', 1, 5 ), '.' ) RESULT
FROM DUAL
;
Found at: http://forums.oracle.com/forums/thread.jspa?messageID=9530500�
The key (best) response where this code is listed is by Solomon Yakobson on Apr 19, 2011 11:48 AM.
Here it is again:
Check this out:
SELECT REGEXP_SUBSTR( '001.069012...3301', '([^.]*)(.|$)', 1, 5, NULL, 1 ) RESULT
FROM DUAL
;
This only works on 11g.
If you are on 10g, use this:
SELECT RTRIM( REGEXP_SUBSTR( '001.069012...3301', '[^.]*(.|$)', 1, 5 ), '.' ) RESULT
FROM DUAL
;
Found at: http://forums.oracle.com/forums/thread.jspa?messageID=9530500�
The key (best) response where this code is listed is by Solomon Yakobson on Apr 19, 2011 11:48 AM.