Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / June 2006

Tip: Looking for answers? Try searching our database.

error when inserting xml into database - string literal too long

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nikki - 24 Jun 2006 07:01 GMT
When executing my insert statement, I am receiving the error message
'string literal too long'. The field is an xml datatype and I am
inserting the xml as a string. Do I need to convert it to a clob? What
else might I need to do? Please advise.

Thanks.
Mark A - 24 Jun 2006 07:51 GMT
> When executing my insert statement, I am receiving the error message
> 'string literal too long'. The field is an xml datatype and I am
> inserting the xml as a string. Do I need to convert it to a clob? What
> else might I need to do? Please advise.
>
> Thanks.

Please indicate your DB2 version and operating system and whether you are
using XML Extender.
Nikki - 24 Jun 2006 15:35 GMT
> > When executing my insert statement, I am receiving the error message
> > 'string literal too long'. The field is an xml datatype and I am
[quoted text clipped - 5 lines]
> Please indicate your DB2 version and operating system and whether you are
> using XML Extender.

DB2 9 Viper on AIX

Thanks,

Nicole
Mark A - 24 Jun 2006 16:46 GMT
> DB2 9 Viper on AIX
>
> Thanks,
>
> Nicole

So you are using native XML support provided in DB2 9.1 (of which you have
beta copy since it has not been released yet)?
Serge Rielau - 24 Jun 2006 11:45 GMT
> When executing my insert statement, I am receiving the error message
> 'string literal too long'. The field is an xml datatype and I am
> inserting the xml as a string. Do I need to convert it to a clob? What
> else might I need to do? Please advise.
>
> Thanks.

I think the longest permissable literal in DB2 is ~32000 Bytes (not
characters in a unicode database!). So if your XML document in string
format exceeds that it will need to be CLOB and you need to bind it in
via a parameter marker or host variable.
(using parameter markers is a good thing anyway :-)
Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ondemandbusiness/conf2006/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.