0

I am getting a conversion error when calling a stored procedure in AS400/RPG/DB2 using iSeries.

The db2 param is defined as CHAR 32000 and the .net app is passing in about 20000 characters and the call throws an error.

This error seems to occur when the .net app is passing data that contains double byte chars. How do I pass a string to a DB2 stored procedure that contains double byte characters?

The IBM Error code is 6107.

Arcadian
  • 4,312
  • 12
  • 64
  • 107

2 Answers2

0

Perhaps you meant to define it as VARCHAR 32000. CHAR is fixed length, yet your .NET app is not sending the length defined.

WarrenT
  • 4,502
  • 19
  • 27
0

If you are trying to pass 20K double byte characters into a 32K character field, the field isn't long enough. 20K double byte characters takes up 40K space. The other issue may be that you are having CCSID issues. You might want to try VARGRAPHIC to hold double byte characters.

jmarkmurphy
  • 11,030
  • 31
  • 59
  • I dont think it is the size that is causing the issue. I think it is the double byte chars. I would like to know if I need to do something special to the data before passing it to the DB2 procedure via .net prodivder. – Arcadian May 06 '13 at 14:52
  • You might want to check to see if the CCSID on the DB2 side is set to 1200 which means UTF-16. Note that RPG uses UCS-2 which is superceded by UTF-16. The UCS-2 CCSID is 13488, but the two are mostly interchangeable. – jmarkmurphy May 06 '13 at 15:47