If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > ODBC Error: SQLSTATE = S1000, Native error code = -5099

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-27-09, 04:25
Hennie_vd_Berg Hennie_vd_Berg is offline
Registered User
 
Join Date: Apr 2009
Posts: 1
Question 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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On