Solved

substr function

Posted on 2012-04-13
2
485 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
2 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now