Si creo el procedimiento me funciona pero yo quiero prescindir de crear un procedimiento. Hago esto pero me dice que hay un error de sintaxis:
Código SQL
[-]if exists (select * from Tabla1 t where t.Cod=2) then
update Tabla1 t set Cantidad = 3 where t.Cod = 2;
else
insert into Tabla1 t values (2, 3);
end if;
¿No es posible usar una sentencia IF THEN ELSE fuera de una subrutina?