I hope if someone can help me.
I have this problem when trying to do a proc in MySQL is this way:
DROP PROCEDURE IF EXISTS `insertprivilegio`; CREATE PROCEDURE `insertprivilegio`( IN sprol varchar(50) ) BEGIN set @verify = (select rol from privilegios where rol = sprol ); IF @verify > 0 THEN select 'false'; END IF; END;
I am trying to verify if there is a
role in the
privileges table at the time of executing it. It allows me to enter the first data, but if I try to register a new record to know if the verification is valid I get this error:
ER_SUBQUERY_NO_1_ROW: Subquery returns more than 1 row
I would appreciate your opinions to know what I'm doing wrong, thanks.