MySQL相当于RAISERROR

时间:2016-08-12 18:10:53

标签: mysql sql

SQL Server中的RAISERROR等效的MySQL是什么?

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

1 个答案:

答案 0 :(得分:0)

    SET @s = 'Unknown condition type  !';
    SIGNAL SQLSTATE '45001' SET MESSAGE_TEXT = @s;