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 > Problem inserting rows from Java

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-05, 08:15
lsalotto lsalotto is offline
Registered User
 
Join Date: Nov 2005
Posts: 4
Problem inserting rows from Java

Hi I got a question is there a posiblity that when you try to do an insert from a Java application you CAN NOT insert a value as long as the row definition says?
I mean I want to insert a string with length 250 to a column with definition VARCHAR (250) and when I try to do the insert from the Java app, I get the following error
Quote:
Error: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0433N Value "BOM inserts = 36; Bom updates = 0; BOM deletes = 0; Props in" is too long. SQLSTATE=22001
I do the same insert but with 249 length string and it works, of course I have checked the code and it is not adding an extra char (as a space or something like)

When I try inserting from the AIX command line (the same query as in the java code) I can insert without troubles.

I'm using DB2 V8.1.1.61 FixPack 6 ESE on AIX 5.2, and the java driver we are using is COM.ibm.db2.jdbc.app.DB2Driver
Reply With Quote
  #2 (permalink)  
Old 12-13-05, 09:19
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
That error looks like it's coming from a user-defined function or stored procedure... are you sure DB2 is actually generating the error? Could be the procedure's length check isn't doing the right thing.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #3 (permalink)  
Old 12-14-05, 12:57
lsalotto lsalotto is offline
Registered User
 
Join Date: Nov 2005
Posts: 4
I am getting this error in a java app and it is from DB2:
Error: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0433N Value "BOM inserts = 36; Bom updates = 0; BOM deletes = 0; Props in" is too long. SQLSTATE=22001

I'm using DB2 V8.1.1.61 FixPack 6 ESE on AIX 5.2, and the java driver we are using is COM.ibm.db2.jdbc.app.DB2Driver

In the insert clause I have a value with 250 chars, and the column definition is 250 too.
Actually, the same insert clause works fine from aix db2 command line, but not from a java db2 client ( like squirrel )
from where I am getting the same error.
Does anyone know why I cannot fill completely a field using java driver?
Reply With Quote
  #4 (permalink)  
Old 12-14-05, 13:14
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Care to post the insert statement?
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