Solved

Help with XML data type conversion

Posted on 2013-01-28
2
292 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now