Forum Discussion

hb's avatar
hb
Occasional Contributor
5 years ago

db2 stored procedure with decimal datatype gives "CLI0111E Numeric value out of range SQLSTATE=22003

I am executing a db2 stored procedure with decimal(10) as the parameter type, i tried with both adDecimal and adNumeric with size as well, still get the same issue, same procedure call in Oracle and MSSQL works fine as the datatype there is integer.

var prm4 = cmdObj.CreateParameter("mc_id", adDecimal, adParamInput);
cmdObj.Parameters.Append(prm4);
prm1.size=10;
prm4.Value=mc_id;

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Just to double check:

    cmdObj.Parameters.Append(prm4);
    prm1.size=10;
    prm4.Value=mc_id;

     

    Is it a typo to reference prm1 instead of prm4 or not?

     

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    This TestComplete forum probably isn't the best place for db2 support.  Did you try finding a db2 forum?

    • hb's avatar
      hb
      Occasional Contributor

      The issue is only happening when i invoke it from Test complete, it is doesnot occur when i invoke that stored procedure direclty from the DB itself or our applicaiton. 

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Okay, that's important.  Without complete details of your test, it's difficult to guess what might be going on.

         

        If I was troubleshooting this, I would take the "numeric value out of range" and work with that.  If you are calculating this value, then try hardcoding it instead and use the value that you think it sending through, for instance, if the calculated value should be 10000, hard code that instead and see if it works.  The calculation may not be working the way you think it is. 

         

        If the value is stored in a variable, make sure that the variable is of the proper type to give you the answer you expect.