0
I’m doing this Rigger to check if it already exists dados_id
and referente_obs
in the bank table
But returns this error:
1241 - Operand should contain 1 column(s);
BEGIN
IF (NEW.id_dados and NEW.referente_obs) not in (
select A.id_dados,A.referente_obs
From banco as A
where (NEW.id_dados = A.id_dados and NEW.referente_obs = A.referente_obs)
) THEN
CALL `Insert Not Allowed.`;
END IF;
END
Good afternoon Cleber, since already thank you for your attention tried to realize your idea but returned me #1241 - Operand should contain 2 column(s) <pre><code>BEFORE INSERT ON
banco
FOR EACH ROW BEGIN
 IF (NEW.id_dados, NEW.referente_obs) not in (
(
 select A.id_dados
 From banco as A 
 where NEW.id_dados = A.id_dados
),
(
 select A.referente_obs
 From banco as A 
 where NEW.referente_obs = A.referente_obs
)) THEN CALLInsert Not Allowed.
; END IF; END</code></pre>– Matheus Gonzales
I think you will have to dismember in two conditionals. I will edit the answer, see again after I change, please?
– Cleber Griff
Cleber, I put the full Trigger in a reply above
– Matheus Gonzales