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 > String in the UPDATE or INSERT statement is too long

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-09, 01:58
Dayakar.venkivolu Dayakar.venkivolu is offline
Registered User
 
Join Date: Dec 2008
Posts: 5
String in the UPDATE or INSERT statement is too long

Hi,

I get below mentioned error when I tried to execute an Update query against DB2 9.1 server:
"SQL0404N A string in the UPDATE or INSERT statement is too long for column
"". SQLSTATE=22001"


Here is the definition of Table(RAC):


ColumnName DataType
--------- --------

VALID Integer
PARTID Integer
STRVAL LONG VARCHAR



Here is the query I have used to update the above table:

UPDATE RAC SET STRVAL = 'String is of length 8,000 characters......' where VALID = 20

I wonder eventhough the column of type LONG VARCHAR has capability to store 16k chararcters why did
I get the above mentioned error.
How to resolve this error?


Regards,
Dayakar
Reply With Quote
  #2 (permalink)  
Old 01-13-09, 03:37
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Something in what you wrote doesn't line up: The limit for LONG VARCHAR is 32700 bytes - not 16K as you state.

You are aware that LONG VARCHAR is deprecated and shouldn't be used any longer? I wouldn't be surprised if the error message is due to something not being supported for this type. You should switch to VARCHAR or CLOB instead.

How do you execute the statement? Maybe your shell clobbers it? Or do you have an application that executes the statement dynamically? If the latter, have you considered parameter markers since they avoid hassles with escaping strings and SQL injection security problems.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
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