If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Varchar characters truncated

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-04, 06:25
shwetaj shwetaj is offline
Registered User
 
Join Date: Dec 2004
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 12-13-04, 11:44
achiola achiola is offline
Registered User
 
Join Date: May 2002
Location: General Deheza, Cba, Arg.
Posts: 273
hi shwetaj,

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

bye
abel.
Reply With Quote
  #3 (permalink)  
Old 12-16-04, 07:19
shwetaj shwetaj is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 12-16-04, 07:51
achiola achiola is offline
Registered User
 
Join Date: May 2002
Location: General Deheza, Cba, Arg.
Posts: 273
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.
Reply With Quote
  #5 (permalink)  
Old 12-16-04, 07:57
achiola achiola is offline
Registered User
 
Join Date: May 2002
Location: General Deheza, Cba, Arg.
Posts: 273
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On