MySQL Forums
Forum List  »  Stored Procedures

Re: Store Procedure doesn´t update.
Posted by: Peter Brawley
Date: January 28, 2015 11:34AM

> SELECT COUNT(P.cod_patient) FROM HOSP.PATIENT AS P;

doesn't update anything.

UPDATE HOSP.ESTATISTIC SET total_patient_bd = total_patient;

will update total_patient_bd in every row of estatistic; is that desired?

Why not skip the sproc altogether and just write ...

update estatistic set total_patient_bd=(select count(p_cod_patient) from patient):

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Store Procedure doesn´t update.
937
January 28, 2015 11:34AM


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.