apex_util.string_to_table: how to handle double-quote
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