Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Equivalent of RAISERROR

Tags:

sql

mysql

What is the MySQL equivalent of RAISERROR in SQL Server?

CREATE procedure GetallFiles()
as
begin
if not exists(select files.Files,Users.FirstName,Users.LastName,Users.EmailAddress from files,Users
where files.UserID = Users.UserID)
raiserror('cannot find files records',16,1)
end
begin

select files.Files,Users.firstname,Users.lastname,Users.EmailAddress from files,Users
where files.UserID = Users.UserID
end
return
like image 519
David Jones Avatar asked Oct 20 '25 11:10

David Jones


1 Answers

    SET @s = 'Unknown condition type  !';
    SIGNAL SQLSTATE '45001' SET MESSAGE_TEXT = @s;
like image 67
Andrey Rubanko Avatar answered Oct 23 '25 01:10

Andrey Rubanko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!