When executin the "Call MYPROC(PAR1,PAR2,PAR3)" from MySQL Query Browser it works OK, altrough I noticed that it returns data - it shouldn't.
But when executing from my application i get this error
---------------------------
Debugger Exception Notification
---------------------------
Project Prodaja6.exe raised exception class EZSQLException with message 'SQL Error: PROCEDURE prodaja.RECALC_DOK_VREDNOST can't return a result set in the given context'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
Why??? I just want to modify a value in one field. I think the error is somehow related to the usage of user defined variables (the @vrednost_dok). BTW: I call all the procedures the same way and it works OK - before editing this procedure also worked OK. The entire procedure is here:
Code: Select all
DELIMITER $$
DROP PROCEDURE IF EXISTS `prodaja`.`RECALC_DOK_VREDNOST` $$
CREATE PROCEDURE `RECALC_DOK_VREDNOST`(IN INPUT_TIP Int, IN INPUT_ID Int, IN INPUT_IZHOD Char(1))
MODIFIES SQL DATA
COMMENT 'Izračun vrednosti dokumenta'
BEGIN
If INPUT_IZHOD="D" Then
Select @VREDNOST_DOK := Sum(PC*KOL*(1+DDV/100)) As VRED_PC
From IZH_POSTAVKE
Where DOK_TIP=INPUT_TIP And DOK_ID=INPUT_ID
Group By DOK_TIP,DOK_ID;
Update IZH_DOK Set VREDNOST=@VREDNOST_DOK Where TIP_DOK=INPUT_TIP And ID=INPUT_ID;
End If;
END $$
DELIMITER ;