Stored procedure client error ....

From: Raquel (raquel_at_nospam.com)
Date: 06/11/04


Date: Fri, 11 Jun 2004 04:44:34 -0400

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.