0
Well I am mounting a procedure in Mysql, and inside it I have the following code:
DECLARE valorConta DECIMAL DEFAULT 0;
DECLARE valorPGConta DECIMAL DEFAULT 0;
SELECT Valor INTO valorConta
FROM Contas
WHERE Cod = CodConta;
IF valorPGConta >= valorConta THEN
ELSE
END IF;
Well I declared 2 variables being them valorConta and valorPGConta.
On the table Contas I have both fields Valor and ValorPG.
I need to know how to assign the values in the 2 variables and then do the verification in the IF.
I ended up finding a way to do it using just one
select. Thus:SELECT Valor, ValorPG INTO valorConta, valorPGConta– Hugo Borges
You can post your solution to your question.
– Danizavtz