Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2004
    Posts
    2

    Unanswered: DB2 Varchar characters truncated

    Hi,
    I have a problem. I am Using DB version 8.1. I have created a table which has a varchar field with length 3500 characters. Whenever I try to insert data in it, the message is truncated to 1023 or 1022 characters.
    This happens when I execute the query through my java program. But an update to the same record explicitly done with a database entry tool takes the field value completely. But a insert done with the same tool again truncates the value to 1022 or 1023 characters.
    Can somebody help me with this ?
    Thanking in advance...

    Regards
    shwetaj

  2. #2
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276
    hi shwetaj,

    please check your definition into java program (data type).

    bye
    abel.

  3. #3
    Join Date
    Dec 2004
    Posts
    2
    Hey,
    Thanks for suggesting that. But when I try to insert data through the DB2 command center...even then the characters are truncated. So irrespective of what data type i use in my java program...String data more than 1023 characters is not being inserted.

    shwetaj

  4. #4
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276
    hi again,
    I test create a table with a column varchar(4000) and insert a record with 1700 character and work fine.

    how know the length of your record?

    I run this select:
    select length(column) from table.

    Abel.

  5. #5
    Join Date
    May 2002
    Location
    General Deheza, Cba, Arg.
    Posts
    276
    hi again,
    I test create a table with a column varchar(4000) and insert a record with 1700 character and work fine.

    how know the length of your record?

    I run this select:
    select length(column) from table.

    Abel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •