Solved

Help with XML data type conversion

Posted on 2013-01-28
2
296 Views
Last Modified: 2013-01-31
I'm converting xml data type in db2 to varchar data type using long varchar. Currently for some reason when I query the database I have being getting errors. Its seems some of the values for that particular column is way longer than the long varchar can handle. I tried using clob and blob and got errors. Is there another alternative to long varchar in DB2?
0
Comment
Question by:olongus
2 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 38828190
What error are you getting? CLOB is the replacement for LONG VARCHAR for quite some time in DB2 - did you put the lenghts in CLOB as well? What driver exists in between (if any) and waht config?

<<
The replacement for LONG VARCHAR is CLOB. Both are stored in a separate area (not in the row on the data page with other columns) which is why it does not impact the 32677 page size limit (not counting page overhead).

Make sure you have file caching on for any tablespace with a LOB column (best to have a separate tablespace for LONG objects).

You would be better off performance-wise if you created two tables without LOB’s or LONG VARCHAR and linked them together.
>>

more details at:
http://www.dbforums.com/db2/1635323-row-length-table-exceeded-limit-32677-bytes.html
http://bytes.com/topic/db2/answers/182299-unable-load-data-into-long-varchar-field

Would it be maybe because you have some double byte char in your XML? These are SBCS data types: http://dbpedias.com/wiki/DB2_LUW:Character_String_Types
0
 

Author Comment

by:olongus
ID: 38828974
Below is th query.

SELECT*
FROM  OPENQUERY (XXXXXXXXX,'SELECT CAST(XXXX AS LONG VARCHAR) AS XMLSTRING, LAST_UPDATE_BY
FROM TABLE)

I'm getting the error below.

A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)


When I run the query data is initailly returned but when it reach a particular row execution stop and the error above is dispalyed.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question