MySQL Forums
Forum List  »  Stored Procedures

Re: SQl to MYSQL
Posted by: Peter Brawley
Date: June 30, 2018 08:52PM

Each If... construct is missing three things ...

(i) IF >.. THEN --- THEN is required

(ii) statements require terminating semicolons

(iii) the IF construct must close with END IF;

Thus ...
if exists (Select * from VIAGENS where ID_VIATURA = pID_VIATURA AND  pDATAHORAINICIO between DATAHORAINICIO and DATAHORAFINAL ) THEN
  set DisponibilidadeViatura = 0;
else
  set DisponibilidadeViatura = 1;
END IF;

Likewise for the other IF constructs.



Edited 1 time(s). Last edit at 06/30/2018 08:52PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
1263
June 30, 2018 10:32AM
Re: SQl to MYSQL
459
June 30, 2018 08:52PM


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.