Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

apex_util.string_to_table: how to handle double-quote

Kevin ZhangJun 10 2011 — edited Jun 15 2011
Hi All:

I am trying to use APEX_UTIL.STRING_TO_TABLE function to parse some string which is comma dilimited and field OPTIONALLY ENCLOSED BY '"' (doubl-quote).

When I execute the following piece of code:

DECLARE
v_data_array wwv_flow_global.vc_arr2;

BEGIN
v_data_array := apex_util.string_to_table('"A,A1","B",', ',');

dbms_output.put_line(v_data_array.COUNT);

FOR i IN 1 .. v_data_array.COUNT
LOOP
dbms_output.put_line(v_data_array(i));
END LOOP;

END;
/

The result would be (which is not what I want, since it didn't handle double-quote):

4
"A
A1"
"B"
<== Null

However, my expected good result should be:
3
A,A1
B
<== Null


Is there other seeded APEX function I can use to achieve this? I really don't want to write my parsing code to handle double-quote for delimited string.


Thanks!

Kevin
This post has been answered by fac586 on Jun 14 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2011
Added on Jun 10 2011
14 comments
2,355 views