Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: problem insert on clob field

Re: problem insert on clob field

From: John K. Hinsdale <hin_at_alma.com>
Date: 16 Jan 2007 10:04:34 -0800
Message-ID: <1168970673.142893.15820@38g2000cwa.googlegroups.com>


Bruintje Beer wrote:
> I have a problem inserting a clob field in a database table. My table
> create table T1(id int, xmlmsg clob);
> when I do an insert on this table with a big xmlmsg i get an error that he
> string literal is too long.
>
> insert into T1(id, xmlmsg) values(1, 'her comes a very big xml string');

Instead of a huge string literal, you can use SQL*Loader:

This works for me. Your milesage may vary. Note that it may be better or worse that your XML files are separated out. Also note that single quotes would have to be escaped (doubled) using literals whereas w/ this they do not.

If you are always adding (not updating), you can just allow the "filename" column to live permanently in T1, then you dont' nee the temp table. But make sure to change "truncate" to "append" in the control file.

Hope that helps.

John Hinsdale Received on Tue Jan 16 2007 - 12:04:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US