Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Question Unanswered: ODBC Error: SQLSTATE = S1000, Native error code = -5099

    I created a stored procedure:

    CREATE PROCEDURE SideCheckUpdate(IN :vSU_ID INTEGER, IN :vBoardThick INTEGER, IN :vComp_ID INTEGER);
    BEGIN

    DECLARE :vNumberOfSides INTEGER;
    SELECT Quantity INTO :vNumberOfSides FROM WO_UNITCOMPONENTS WHERE SU_ID = :vSU_ID AND Comp_ID = 0;

    IF (:vNumberOfSides > 0) THEN
    UPDATE WO_UNITCOMPONENTS SET WO_UNITCOMPONENTS.Clength = (SELECT WO_UNITS.TOTAL_Width - (:vBoardThick * :vNumberOfSides) FROM WO_UNITS Where UnitCode = WO_UNITS.Code) WHERE WO_UNITCOMPONENTS.Comp_ID = :vComp_ID;

    ELSE
    UPDATE WO_UNITCOMPONENTS SET WO_UNITCOMPONENTS.Clength = (SELECT WO_UNITS.TOTAL_Width FROM WO_UNITS Where UnitCode = WO_UNITS.Code) WHERE WO_UNITCOMPONENTS.Comp_ID = :vComp_ID;

    END IF;

    END;

    The update before the ELSE create an error "ODBC Error: SQLSTATE = S1000, Native error code = -5099
    Error in expression: WO_UNITS . TOTAL_Width - ( :vBoardThick * :vNumberOfSides ) " but if I substitute the variables ( :vBoardThick * :vNumberOfSides ) with integers (16 * 2) it works.

    What can I do?
    Last edited by Hennie_vd_Berg; 04-27-09 at 04:29.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •