Wednesday, February 12, 2020

Divide string in Rows format using REGEXP_SUBSTR

Using REGEXP_SUBSTR we will separate string in rows

Example:

String: 'Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam'  -- you will replace with Variable or field or other string.

Separator: |   -- you will use another symbol (eg. $, #, comma(,) etc.)


SELECT regexp_substr('Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam','[^|]+', 1, LEVEL) Employee_Name
FROM dual
CONNECT BY regexp_substr('Sunil|Darshan|Rahul|Ritesh|Pravin|Preetam', '[^|]+', 1, LEVEL) IS NOT NULL;

Output: 

No comments:

Post a Comment

Steps to get ZPL code output using Zebra viewer - Online

Introduction ZPL is a print language used by many label printers. A print language is a set of commands that can be used to draw elements li...