Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Select a string out of random position beginning with a specific character set

switbeckJul 23 2013 — edited Jul 23 2013

Hello everyone, here is the information from my database:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

I'm trying to figure out how to do something like this.  Say I have a string in the middle of a string that I want to extract.   For example:

1) 8781FAHH911122as3_2

2) 877aa-FAHHa222xa342_1

3) F_FAHH10aa49933

4) FAHH123412341R

5) FAHH457894126

What I would want from this would be anything starting with FAHH and the 9 digits after so for the above I would want:

1) FAHH911122as3

2) FAHHa222xa342

3) FAHH10aa49933

4) FAHH123412341

5) FAHH457894126

I've looked at using left/right/substring but my problem is that the part that I want could be in a random location within the string so I cannot designate a starting position.

Any help would be greatly appreciated.

Thanks,

-Steve

This post has been answered by Tubby on Jul 23 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2013
Added on Jul 23 2013
5 comments
1,129 views