MySQL Forums
Forum List  »  Spanish

STORE PROCEDURE
Posted by: Daniel Bernabe Inche Ticlavilca
Date: July 04, 2017 02:00PM

Tengo 2 campos en mi tabla temporal uno de INGRESOS y SALIDAS y uno en blanco de SALDO . Lo que necesito es sumar o restar el valor de estos campos (ingresos y salidas ) a un valor que obtengo con otra consulta @ultimosaldo.

WHILE(@contador > 0 AND @Arow <= @contador) DO
UPDATE t_bincard set c_saldo=@saldo + @var:=c_accion where c_nrorow=@Arow;
set @saldo=@saldo + @var;
set @Arow=@Arow+1;

END WHILE;
select * from t_bincard;

Ya use cursores y no se siente la mejora ya que recorro cada linea aprox. 120 sec en 2k de registros de mi tabla temporal

Options: ReplyQuote


Subject
Views
Written By
Posted
STORE PROCEDURE
191
July 04, 2017 02:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.