How to split delimited string in SQL

Below SQL Function comes very handy when there is a need to split a delimited string. There can be different types of delimiters like “,”, “-”, “_” and so on. The function below takes comma as default delimiter.

For example, if input string is “a-b-c-d”, output will be a collection (VARCHAR2_TT) with values as [a,b,c,d].

The code below also checks if the text starts with encloser for example double quotes (“”).

Hope you find this article useful. Please leave your footprints in comments section below for any queries or suggestions.

  1. With havin so much content do you ever run into any problems of plagorism or copyright violation? My blog has a lot of unique content I’ve either created myself or outsourced but it
    appears a lot of it is popping it up all over the web without my agreement.
    Do you know any ways to help reduce content from being
    ripped off? I’d really appreciate it.

  2. Right here is the right blog for everyone who would like to find out about this topic.
    You understand a whole lot its almost tough to argue with you (not that I really would want to…HaHa).

    You certainly put a new spin on a subject which has been discussed for decades.

    Great stuff, just wonderful!

  3. At this time, we don’t have one for working with strings over 8,000 bytes. I’m sure there are instances where people need to split delimited strings that are longer than 8,000 bytes, but to date, I personally haven’t come across an instance where I needed that functionality.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">