vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| The following is a piece of code from my client application which is trying to call stored procedure SP1: String callstmt = "CALL DB2ADMIN.SP1(?,?,?)"; CallableStatement clst1 = conn.prepareCall(callstmt); String e = "000150"; clst1.setString(1,e); " clst1.setString(1,e);" fails with exception CLI0109E String data right truncation. Why is it not allowing it to be set to "000150"? If I change the above to: String callstmt = "CALL DB2ADMIN.SP1(?,?,?)"; CallableStatement clst1 = conn.prepareCall(callstmt); String e = "5"; clst1.setString(1,e); The program runs fine. Why is it allowing me to only code a single character and not a string of characters. Regards, Raquel. |
| |||
| raquel_rodriguezus@yahoo.com (Raquel) wrote in message news:<9a73b58d.0406110043.6359bde4@posting.google. com>... > The following is a piece of code from my client application which is > trying to call stored procedure SP1: > > String callstmt = "CALL DB2ADMIN.SP1(?,?,?)"; > CallableStatement clst1 = conn.prepareCall(callstmt); > String e = "000150"; > clst1.setString(1,e); > > " clst1.setString(1,e);" fails with exception CLI0109E String data > right truncation. > > Why is it not allowing it to be set to "000150"? If I change the > above to: > > String callstmt = "CALL DB2ADMIN.SP1(?,?,?)"; > CallableStatement clst1 = conn.prepareCall(callstmt); > String e = "5"; > clst1.setString(1,e); > > The program runs fine. Why is it allowing me to only code a single > character and not a string of characters. > > Regards, > Raquel. Check the define of you J-SP, the first input argument maybe a char(1) Richard. |