hi guys,
exporting data into a csv file using 10GR2 utl_file
need to check if data from several fields have comma(s) in them and, if so (iaw client's spec), wrap column data in double quotes (normal standard for csv files)
eg ...
qwerty = qwerty
qwe,rty = "qwe,rty"
qw,er,ty = "qw,er,ty"
planning to use following function unless anybody has other bright ideas ?
========================
FUNCTION CSV_QUOTE (DataIn IN varchar2)
RETURN varchar2
IS
DataOut varchar2(5000);
BEGIN
select decode(instr(instr(DataIn, ','), '0'), 1, DataIn, '"' || DataIn || '"') into DataOut from dual;
RETURN DataOut;
END CSV_QUOTE;
=========================
tanx in advance ...
regards, david - no such thing as problems - only solutions.
exporting data into a csv file using 10GR2 utl_file
need to check if data from several fields have comma(s) in them and, if so (iaw client's spec), wrap column data in double quotes (normal standard for csv files)
eg ...
qwerty = qwerty
qwe,rty = "qwe,rty"
qw,er,ty = "qw,er,ty"
planning to use following function unless anybody has other bright ideas ?
========================
FUNCTION CSV_QUOTE (DataIn IN varchar2)
RETURN varchar2
IS
DataOut varchar2(5000);
BEGIN
select decode(instr(instr(DataIn, ','), '0'), 1, DataIn, '"' || DataIn || '"') into DataOut from dual;
RETURN DataOut;
END CSV_QUOTE;
=========================
tanx in advance ...
regards, david - no such thing as problems - only solutions.