If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > problem insert long XML into DB2 table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-18-12, 05:47
Kilimanjaro Kilimanjaro is offline
Registered User
 
Join Date: Jan 2012
Posts: 8
problem insert long XML into DB2 table

I have a simple table containing a XML field. Normally I will just use
Quote:
INSERT INTO TABLE VALUES (1, '<xml>my xml</xml>', 'N', 'Y')
and it always works.

But this time I have a very long XML(69632 Bytes) to insert, db2 give me a SQL0102N error.

Then I tried to save my command in a sql file and run it by
Quote:
db2 -td@ -s -f"pathToMySQLFile\mycommand.sql"
. But I got exactly the same error.

I tried also to use import option of table in control center, then I got SQL3115W The field value beginning "'<?xml version="1.0" ?>" in row
"1" and column "2" is longer than the longest allowable table column. The
value was truncated.

Now I am stuck. How can I insert this long XML into my table? Any help please? I am using DB2 Enterprise 9.7.

Last edited by Kilimanjaro; 06-18-12 at 05:52.
Reply With Quote
  #2 (permalink)  
Old 06-18-12, 06:03
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,749
according the doc

Since the import utility restricts the size of a single column value to 32 KB, extra considerations need to be taken when importing LOBs.
put the lob in a file and use modified by lobsinfile with import command
LOB import considerations
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 06-18-12, 06:07
Kilimanjaro Kilimanjaro is offline
Registered User
 
Join Date: Jan 2012
Posts: 8
thanks a lot! I have not thought of that. Will try it now.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On