?
Solved

what is syntax for stripping characters from a field value and leaving the remaining to query against another field

Posted on 2011-02-25
6
Medium Priority
?
324 Views
Last Modified: 2012-05-11
I need to get the latter characters from a field and compare it with the field value in another table. What is the syntax to strip the characters that I don't need and use only the characters I do need in a query?

This is what I have:

select count(*) from dc_rule
where Doc_I in
(select pdf from holdings
  where pub_date >='01-JAN-10'
              and pub_date<='31-DEC-10');

dc_rule field has the following value:

RDBAFM_ORA10://cpia_lib/CPIA-1995-0525

I don't want to remove any characters. I just want to capture a portion of the value of the field and compare it to another field. For example I only want CPIA-1995-0525 in the above sample. Is that possible? If so How would I do this?


0
Comment
Question by:sikyala
[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
  • 3
  • 3
6 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 34982287
parsing is all about rules, you haven't specified how we identify which piece of the string you would want.

So I'll take a guess.

You want the substring following the last "/"  character.

try this...


regexp_substr(dc_rule,'[^/]+$')
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34982308
if the rule for extracting the piece you want is something else, please specify and I'll adjust accordingly
0
 

Author Comment

by:sikyala
ID: 34982317
I basically want to exclude RDBAFM_ORA10://cpia_lib/
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 2000 total points
ID: 34982346
that's even simpler

REPLACE(dc_rule, 'RDBAFM_ORA10://cpia_lib/')
0
 

Author Comment

by:sikyala
ID: 34982350
sdstuber: exactly it worked. Thanks
0
 

Author Closing Comment

by:sikyala
ID: 34982542
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 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