0

Unfortunately I having a few issues now trying to get this going as my data has changed based on an original thread I started see:

Retrieving certain strings within a string using Oracle SQL

My data has now changed to look like:

member_of = CN=DAaXYZApple-Au, CN=DAaXYZApple-Readonly, CN=aXYZApple-Write, CN=DAaXYZApple-Au-Admin, CN=aTest123_RW, {CN=# XXY22,} CN=aInternet-1

Using the same type of techniques described in my original post, I need to obtain all strings that hold the string "aXYZApple" only. So based on the above, the following results is what I am after and would be displayed only:

aXYZApple-Au
aXYZApple-Readonly
aXYZApple-Write
aXYZApple-Au-Admin

I am unsure if I still need to use Oracle regexp_substr as in my original post.

4
  • I have managed to solve this issue - no longer require assistance. Commented Jun 13, 2012 at 2:51
  • 1
    Post the solution as an answer? Commented Jun 13, 2012 at 2:55
  • As @Pedantic mentioned - please post the solution as an answer. You can aceept it later on Commented Jun 13, 2012 at 7:36
  • Apologies - pls see my answer below. Commented Jun 14, 2012 at 3:32

1 Answer 1

1

The solution for my own question based on updated dataset is as follows, which is pretty much based on the solution provided to me in my original question, i.e.:

SELECT regexp_substr(line, 'aXYZApple[^,]*') subtxt
FROM (SELECT regexp_substr(:x, '[^,]*\,', 1, rownum + 1) line
      FROM dual
      CONNECT BY LEVEL <= length(:x) - length(REPLACE(:x, ',', '')))
WHERE line LIKE '%aXYZApple%';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.