| Import CSV in clob to table [message #563281] |
Fri, 10 August 2012 15:42  |
 |
ufzc3mj8
Messages: 3 Registered: August 2012 Location: United States
|
Junior Member |
|
|
Hi all,
I'm trying to import data from a csv file format which is located in a CLOB column in a single record in the database. I want to import the data that is contained in this CLOB into a table. I am having limited success using JH_UTIL. Here's the script that I am running (which works):
set serveroutput on;
declare
v_lines jh_util.stringlist_t;
v_values jh_util.stringlist_t;
begin
for rec in (select 1 id, ac.clob_content csv
FROM PSM_ASSET a INNER JOIN PSM_ASSETCONTENT ac ON ac.asset_id = a.id
WHERE name = 'teachercommentupload1.txt') loop
v_lines := jh_util.split(rec.csv, chr(10));
for i in v_lines.first .. v_lines.last loop
dbms_output.put_line('line ' || i || ':');
v_values := jh_util.split(v_lines(i), chr(9)); --Yes, I know this is a tab CHR and not CMA
/* I will eventually insert the values into the table */
for j in v_values.first .. v_values.last loop
dbms_output.put_line('v_values(' || j || ') = ' || v_values(j));
end loop;
end loop;
end loop;
end;
The problem is when the file gets too big, I get a the following error:
Error report:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 6
06502. 00000 - "PL/SQL: numeric or value error%s"
*Cause:
*Action:
I assume this means because the file size is too big. Is there any way to process larger "files" (CLOB data)
Thanks in advance for any assistance you can provide.
[Updated on: Sat, 11 August 2012 00:27] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|