Solved

substr function

Posted on 2012-04-13
2
486 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

Suggested Solutions

Title # Comments Views Activity
MULTIPLE DATE QUERY 15 91
DB migration from Mssql to 12c oracle , data not loading. 3 39
Creation date for a PDB 5 39
Read XML values 8 41
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

839 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