How to create a delimited string in SQL

Below is simple SQL Function to create a delimited string. If no delimiter is provided, it takes comma (“,”) as default delimiter and creates a comma separated delimited string. There can be many other delimiters like “|”, “-”, “_” and so on.

For example, if input is a collection (VARCHAR2_TT) [a,b,c,d], and “-” is the chosen delimiter, output will be a-b-c-d.

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

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="">