SELECT c.horas_aportadas
INTO horas_aportadas_coordinador
FROM voluntario c
WHERE new.id_coordinador = c.nro_voluntario;
In that code, the id_coordinador
is an attribute that can be null, so if it is then the query does not return anything, and what I want to know is that it is saved in the variable horas_aportadas_coordinador
.
Do you save a null value, or do you keep the value that I assign by default when you create it (When you create the variable, assign it a -1)?