MySQL Forums
Forum List  »  Stored Procedures

Re: MSSQL Developer trying to learn MySQL
Posted by: Peter Brawley
Date: May 26, 2021 11:22AM

IF(...) is a function; IF...THEN...END IF is a block construct, supported only in stored routines.

And RaiseError() is a MSSQL func. In MySQL read about SIGNAL, RESIGNAL, eg ...

IF NOT EXISTS( SELECT ... ) THEN
  BEGIN
    SET @s = 'some msg';
    SIGNAL SQLSTATE '45001' SET MESSAGE_TEXT = @s;
  END;
END IF;



Edited 1 time(s). Last edit at 05/26/2021 12:11PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MSSQL Developer trying to learn MySQL
196
May 26, 2021 11:22AM


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.