01-13-09, 02:58 #1Registered User
- Join Date
- Dec 2008
Unanswered: String in the UPDATE or INSERT statement is too long
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
Here is the definition of Table(RAC):
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?
01-13-09, 04:37 #2Registered User
- Join Date
- Jan 2007
- Jena, Germany
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