Solved

Help with XML data type conversion

Posted on 2013-01-28
2
300 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 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
encrypt SQL Server 2008 port 1433 3 44
SQL Query Works in SQL 2008 & 2012 But Not SQL 2016 15 98
how to resize column length with primary ket 4 32
T-SQL: Wrong Result 7 36
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

739 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