Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with XML data type conversion

Posted on 2013-01-28
2
Medium Priority
?
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

610 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