• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

DB2 VARCHAR Truncation

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I running an nt client w/ IE 5.x, apache web server, JRUN, and DB2 on an OS/390. I have a data truncation problem when inserting a row into a column defined as a VARCHAR(3000).
Only 255 out of 1000 bytes is being inserted.
Any ideas...

[This message has been edited by Monty Ireland (edited December 14, 2001).]
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what DB2's limitations are, but after a certain length or a string, you have to stream the data into the database(but usually an exception is thrown???). Are you streaming the data in? Post a code snippet showing the insert procedure, that should help us help you!
Jamie
 
Monty Ireland
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm in the middle of porting a software package from oracle to db2... code sample is unavailable at this time... but, the code works on sql-server and oracle. My client is using a prepared statement to select a row from an application table.
Thanks for asking...
And the answer is... the database engine.
select * from table where varchar100 = 'fred' works
select * from table where varchar255 = 'fred' works
select * from table where varchar256 = 'fred' fails
select * from table where varchar999 = 'fred' fails
If you replace the string 'fred' with a host variable containing the string 'fred'. Then all of the sql queries above will then work! I am in the process of opening a PMR request with IBM tosee if there is an APAR to fix this problem...


[This message has been edited by Monty Ireland (edited December 14, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!