?
Solved

substr function

Posted on 2012-04-13
2
Medium Priority
?
491 Views
Last Modified: 2012-06-27
I am trying to achieve the following by using the SUBSTR function,

I have some data as below,

object 1 is XXX-ABXXXX
object 2 is XXX-ABCDEXXXX
object 3 is XXX-ABCDXX

where x is any number from 0 to 9
Now that I want to extract the the trailing X from the three objects I cannot achieve the desired results owing to the different structure of the three objects.


Can anyone suggest if there is a possibility that I can extract the all the trailing X from the three objects so that none of the X is missing. Maybe some check where the char 'D' ends it should start extracting X until the end.

Pls advice.

Regards
0
Comment
Question by:SANbuddies
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 37842783
Try this:
select regexp_substr('000-abc123','[0-9]+$') from dual;
0
 

Author Closing Comment

by:SANbuddies
ID: 37843158
Thanks
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question