Solved

Parsing data in oracle sql using substr

Posted on 2011-03-07
1
383 Views
Last Modified: 2012-05-11
Trying to parse data in a field

data has the following C3,5,35

need it to look like this

Repair Code1     Repair Code 2      Repair Code 3
C3                        5                         35

select
REGEXP_SUBSTR (NVL (historical_separate.work_done, active_separate.work_done),'[^,]+') "Repair Code1",  What are the next statements to get repair code 2 and repair code 3?

Thanks.



0
Comment
Question by:JDay2
[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
1 Comment
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 35060436
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+') "Repair Code1",
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+',1,2) "Repair Code2",
REGEXP_SUBSTR( nvl(historical_separate.work_done, active_separate.work_done),'[^,]+',1,3) "Repair Code3"
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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