Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

substr function

Posted on 2012-04-13
2
Medium Priority
?
492 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

604 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