MySQL Forums
Forum List  »  Triggers

Re: I need help with if statement in my trigger statement
Posted by: Peter Brawley
Date: June 28, 2022 07:15AM

Can't rollback from a Trigger. Try ...

if exists(select 1 from customers where `Last Name`=new.`Last Name`) then
SIGNAL sqlstate '45001' set message_text = 'Customer name exists";
end if;

Also, do not create table or column names with spaces in them, and do not proper case such names.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: I need help with if statement in my trigger statement
96
June 28, 2022 07:15AM


Sorry, only registered users may post in this forum.

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.