Solved

Help with XML data type conversion

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard 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.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

830 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