• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

substring

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a column that has a values like:

ABCDEF*123456*XZY
ABC*QQQ*ZZZ
ABC*CBA*123

How can I get the middle value out using only Oracle built in functions? Someone gave me an example here that uses SUBSTR, but then uses SIGN, DECODE,INSTR, LENGTH to determine how to get that value out. I was hoping for a simplier solution.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well you need Substring, but you also need a function to figure out the start and end point of the middle section. So you find the first "*" with INSTR, and you find the second "*" with INSTR

But I don't see how you would need to other stuff. But it has been a while for me in writing that type of call, so I could be wrong.

Mark
 
I didn't say it. I'm just telling you what this tiny ad said.
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic