Oracle 10g Question

From: <amerar_at_iwc.net>
Date: Thu, 24 Jan 2008 08:51:21 -0800 (PST)
Message-ID: <0beffe24-2b57-47ff-91d9-68ac30ca815f@k2g2000hse.googlegroups.com>

Hi All,

I'm playing with Oracle 10g Regular Expressions. I have a string that looks like this, basically a comma delimited string:

z VARCHAR2(40) := '1:3,4:6,8:10,3:4,7:6,11:12';

What I want to do is basically parse this string. This this example, the 1 would go into the first variable, then the 3 into the second variable, and same for the rest of the string.

I know Oracle has some comma_to_table routine, but I want to try this using these regular expressions. I was using something like this with no luck:

x := REGEXP_SUBSTR(z,'[^:]+', 1, 1);

This returns 1 for the result, which is correct for the first item, but that is as far as I can get.

So, I want to parse this string using a comma as the delimiter between pairs, and then a colon within that to get the 2 values for the variables.

Can this be done using the REGEXP_SUBSTR function???

Thanks! Received on Thu Jan 24 2008 - 10:51:21 CST

Original text of this message